Ack, sent to the wrong email again.
On Wed, Jul 29, 2009 at 9:02 PM, superpollo <[email protected]> wrote:
>
> >>> print '\n'.join("%s - %s" % p for p in enumerate(nomi))
> File "<stdin>", line 1
> print '\n'.join("%s - %s" % p for p in enumerate(nomi))
> ^
> SyntaxError: invalid syntax
lol, I knew I shouldn't have trusted untested code!
> >>> print '\n'.join(["%s - %s" % p for p in enumerate(nomi)])
> 0 - one
> 1 - two
> 2 - three
>
Yup.. but using a variable for the tuple itself was a good move though =P.
--
http://mail.python.org/mailman/listinfo/python-list