>>> def randnum():
... c = []
... for x in range(6):
... s = random.randrange(50)
... c.append(s)
... print 'Randoms: ',c
... c = []
This works good !!
Johan
R. Alan Monroe wrote:
Hey all,
I am trying to create a program that draws 6 numbers between 1 and 49 at random for creating lottery tickets. I want to have a better chance when I play. Can anyone help me code this or show me how
to, please?
Create (empty for now) list to hold your final numbers.
Have a for-loop that runs 6 times using range(6)
Inside the loop, just pick a random number and append it to your final
number list.
Alan
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor
|
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor