[Tutor] printing columns

alan.gauld@bt.com alan.gauld@bt.com
Fri, 21 Jul 2000 17:14:44 +0100


> I have a list of around 650 or so items.  I would like to be able to
> print them in columns, three across, like so:
> 
> item1		item2		item3
> item4		item5		item6
> item7		item8		item9
> 
> Any suggestions on a clean way to accomplish this?  

Use format?

print "%12s%12s%12s" % (item1,item2,item3)

prints 3 items each occupying 12 spaces.

Alan G.