Error messages from format()

Dave Angel d at
Tue Nov 13 22:18:07 CET 2012

On 11/13/2012 03:24 PM, Colin J. Williams wrote:
> <SNIP>
> I am working on the assumption that the first argument of the format
> builtin function and be a sequence of values, which can be selected
> with {1:}, {2:}, {0:} etc.
> The docs don't make this clear.  I would appreciate advice.

The built-in function format():

The first parameter is a single object, NOT a sequence.  One object, one
format.  If you want more generality, use the str.format() method:

where you can supply a list or a dictionary of multiple items to be
formatted into a single string.  That's the one where you supply the
curly braces.



More information about the Python-list mailing list