Give List to Format String - How To

gregpinero at gmail.com gregpinero at gmail.com
Thu Sep 6 04:47:08 CEST 2007


I might just be being dumb tonight, but why doesn't this work:

>>> '%s aaa %s aa %s' % ['test' for i in range(3)]
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: not enough arguments for format string

(I'm in Python 2.4 if that matters)

Thanks,

Greg




More information about the Python-list mailing list