printing with variable length of list

les ander les_ander at yahoo.com
Mon Oct 18 20:55:20 CEST 2004


Hi,
suppose I have a list
d=[1.2 , 31.1, 1.001]
in general i will not know the size of d
however, I would like to print them out nicely in the row format
such as:
print "%-10f "* len(d) % d

however, the above line does not work--python says that float
argument is required.
So  i did
print "%-10s "* len(d) % map(str,d)
But now I get:
TypeError: not enough arguments for format string

please help
thanks



More information about the Python-list mailing list