Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialHela Kacem
728 Pointsrandom_number code not going through. I can't understand the problem
I it says that it can't seem to call the function with an argument
import random
def random_num(x):
random.uniform(1,x)
2 Answers
William Li
Courses Plus Student 26,868 PointsHi, Hela, you almost got it right, the method definition looks good, except that this challenge wants you to use the randint()
method from the random library, not uniform()
.
import random
def random_num(x):
return random.randint(1, x)
Hela Kacem
728 PointsOh thank you very much.