>     print random.randrange(1,42)
> If you want to collect the intermediate results, either store them in a
> list:
>
> results = []
> for i in range(6):
>     results.append(random.randrange(1,42))

Gmail has removed the "Reply All" function for some ABSOLUTELY
RIDICULOUS REASON, so I think people missed my reply on this.

randrange is a horrible way to generate lottery numbers because it
doesn't generate unique numbers, and as for lotteries I don't think
I've seen a single one where they put the balls back before selecting
a new. random.sample is better because it does (for this purpose, at
least) and it stores the result in a list automatically.

Let's hope this email goes to the right thread. :/


-- 
best regards,
Robert S.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to