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 supposed to be a sequence (according to the docs str, unicode, list, tuple, buffer, xrange), I'd expect an exception. I also predicted the the result if no exception was raised, and that was correct.
I will withhold further observation until others (who wish) may reply. -- Bob Gailer 510-978-4454 _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor