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 trialcraigs love
Python Web Development Techdegree Student 96 Pointswhat can do .randint()
can some one tell me why the function is used. Or What the definition of this function.
random.randint(0, 1)
.raindint() # ?????????????????
1 Answer
Serkan van Delden
13,094 PointsIt is used to give a variable a random value. Example: variable = randint(0, 10). This gives "variable" a random value of 0 to 10. Don't forget to import random!