On Wed, Jul 29, 2009 at 8:52 PM, MRAB <[email protected]> wrote:
> Slightly shorter:
>
> print '\n'.join("%s - %s" % p for p in enumerate(nomi))
>
> :-)
>
That's cool. Does that make the "list" a tuple? (not that it matters, I'm
just curious!)
I just tested for a list of 1000 elements (number in letters from 1 to 1000
code I wrote for doing project euler problem 17), and the join method is 0.1
seconds faster than the for loop! Woo!? ;p
-- http://mail.python.org/mailman/listinfo/python-list
