Formatting Output

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Mon Jun 2 10:33:38 CEST 2008


On Mon, 02 Jun 2008 00:34:09 -0700, victor.herasme at gmail.com wrote:

> i am building a little script and i want to output a series of columns
> more or less like this:
> 
> 1  5  6
> 2  2  8
> 2  9  5
> 
> The matter is that i don't know in advance how many columns there will
> be. By the way, each column will be actually FLOATs, not INTs. How can
> i do this ? Any help welcome. Regards,

Look at string methods, `join()` for example, and string formatting with
the ``%`` operator.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list