simplify printing of a list
Jeff Epler
jepler at unpythonic.net
Fri Jun 4 08:08:02 EDT 2004
On Thu, Jun 03, 2004 at 03:08:57PM -0700, beliavsky at aol.com wrote:
> To print a list with a specified format one can write (for example)
>
> for j in [0,1,2]:
> print "%6d"%j,
> print
>
> The code
>
> print "%6d"%[0,1,2]
>
> currently produces a syntax error,
No, it doesn't. (it produces a TypeError)
> but it would be convenient if it
> had the same meaning as the loop above.
No, it wouldn't.
[remainder deleted]
Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20040604/70fdfd7c/attachment.sig>
More information about the Python-list
mailing list