Re: [Tutor] A puzzle for you

2006-10-17 Thread Bob Gailer
John Fouhy wrote: > >From the python_dev LiveJournal community --- > > Predict the outcome of the following code: > > ## > from random import * > seed() > [choice(dict((x+1,0) for x in range(1000))) for x in range(693)][0] > ## > > Well the discussion did not go very far! You got my "prediction"

Re: [Tutor] A puzzle for you

2006-10-17 Thread John Fouhy
On 18/10/06, Terry Carroll <[EMAIL PROTECTED]> wrote: > On Sat, 14 Oct 2006, John Fouhy wrote: > > > >From the python_dev LiveJournal community --- > > > > Predict the outcome of the following code: > > > > ## > > from random import * > > seed() > > [choice(dict((x+1,0) for x in range(1000))) for x

Re: [Tutor] A puzzle for you

2006-10-17 Thread Terry Carroll
On Sat, 14 Oct 2006, John Fouhy wrote: > >From the python_dev LiveJournal community --- > > Predict the outcome of the following code: > > ## > from random import * > seed() > [choice(dict((x+1,0) for x in range(1000))) for x in range(693)][0] > ## On ActivePython 2.4.3: >>> from random import

Re: [Tutor] A puzzle for you

2006-10-14 Thread Bob Gailer
John Fouhy wrote: > >From the python_dev LiveJournal community --- > > Predict the outcome of the following code: > > ## > from random import * > seed() > [choice(dict((x+1,0) for x in range(1000))) for x in range(693)][0] > ## > Hmm - interesting. Given that the argument of random.choice is sup

Re: [Tutor] A puzzle for you

2006-10-14 Thread Glenn T Norton
John Fouhy wrote: >>From the python_dev LiveJournal community --- > >Predict the outcome of the following code: > >## >from random import * >seed() >[choice(dict((x+1,0) for x in range(1000))) for x in range(693)][0] >## > > > random.choice( [ SyntaxError: invalid syntax, 42 the answer is young

[Tutor] A puzzle for you

2006-10-13 Thread John Fouhy
>From the python_dev LiveJournal community --- Predict the outcome of the following code: ## from random import * seed() [choice(dict((x+1,0) for x in range(1000))) for x in range(693)][0] ## -- John. ___ Tutor maillist - Tutor@python.org http://mai