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"
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
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
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
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
>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