simplify printing of a list

Josiah Carlson jcarlson at
Wed Jun 9 00:38:33 CEST 2004

> print "100%6d"%[0,1,2]

The real problem is that "100%6d" already has a meaning in string 
formatting, though not what you like.  On the most part, Python string 
formatting conventions follow C string formatting conventions.  Python 
has added "%(key)s" formatting, and there may be $-formatting in the 
future (I stopped following that thread months ago).

Again, the syntax you offer "100%6d" is already valid, if meaning 
something else.

  - Josiah

More information about the Python-list mailing list