On Wed, Jul 29, 2009 at 8:52 PM, MRAB <span dir="ltr"><<a href="mailto:python@mrabarnett.plus.com">python@mrabarnett.plus.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">Slightly shorter:<br></div></div>
<br>
print '\n'.join("%s - %s" % p for p in enumerate(nomi))<br>
<br>
:-)<div></div></blockquote><div>That's cool. Does that make the "list" a tuple? (not that it matters, I'm just curious!) <br></div></div><br>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<br>