List comprehension and string conversion with formatting

stephen_b redplusbluemakespurple at
Tue Jun 9 11:38:34 EDT 2009

I'd like to convert a list of floats to a list of strings constrained
to one .1f format. These don't work. Is there a better way?

[".1f" % i for i in l]
[(".1f" % i) for i in l]


More information about the Python-list mailing list