Simple formatting string question

Fredrik Lundh effbot at telia.com
Thu Apr 13 15:04:18 EDT 2000


Matthew Hirsch <meh9 at cornell.edu> wrote:
> I'm trying to print something like this:
>
> >>> print 6*'%2i' '%1i' % tuple([5,5,5,5,5,5,1])
>
> but I'm getting an error.

how about:

>>> print (6*'%2i' + '%1i') % tuple([5,5,5,5,5,5,1])

</F>





More information about the Python-list mailing list