Simple formatting string question

Petru Paler ppetru at coltronix.com
Thu Apr 13 15:08:29 EDT 2000


On Thu, Apr 13, 2000 at 02:56:38PM -0400, Matthew Hirsch 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.
> 
> Do you know what the correct syntax should be?

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

-Petru




More information about the Python-list mailing list