> Subject: Re: [Tutor] 6 random numbers > From: [email protected] > Date: Mon, 17 Oct 2011 01:53:18 +0530 > CC: [email protected] > To: [email protected] > > On 17-Oct-2011, at 1:13 AM, ADRIAN KELLY wrote: > > > hello all, > > anyone know how i would go about printing 6 random numbers, i know i could > > copy and paste 6 times (which would work) but i was thinking about a while > > loop, ie. while lottery_numbers.count is <7. > > Is it possible to code this? is it possible to count random variables? i am > > trying to keep the program as simple as possible, cheers > > > > any help would be welcome, > > > > import random > > lottery_numbers=random.randrange(1,42) > > print lottery_numbers > > > > Following example may be useful: > x = [random.randrange(1, 1+random.randrange(42) for _ in range(100)] > > Useful read: > http://docs.python.org/tutorial/datastructures.html > > -- > shantanoo > http://xkcd.com/221/ >
_______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
