[Tutor] Random Numbers

Charlie Derr charliederr@organicmeat.net
Tue, 3 Apr 2001 17:52:34 -0400


~ -----Original Message-----
~ From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of
~ Corey Woodworth
~ Sent: Tuesday, April 03, 2001 4:23 PM
~ To: Python Tutor List
~ Subject: [Tutor] Random Numbers
~
~
~ How does one generate random numbers in python? Say from 1-10 for example?

>>> import random
>>> my_random_number = random.choice(range(1,11))
>>> my_random_number
1
>>> another_one = random.choice(range(1,11))
>>> another_one
5
>>>

~
~ Thanks!
~ Corey

yw

~
~ p.s. I'm still having focus() problems with my texteditor if anyone read
~ those posts :(

sorry, didn't read those posts

~
~
~ _______________________________________________
~ Tutor maillist  -  Tutor@python.org
~ http://mail.python.org/mailman/listinfo/tutor
~