On Jun 9, 10:43 am, Carl Banks wrote:
> You need a % in there, chief.
>
> Carl Banks
You are so right. Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Jun 9, 2009 at 5:38 PM,
stephen_b wrote:
> 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]
> or
> [(".1f" % i) for i in l]
There's a missing %, this does work...
["%.1f" % i for
On Jun 9, 8:38 am, stephen_b wrote:
> 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]
> or
> [(".1f" % i) for i in l]
You need a % in there, chief.
[ "%.1f" % x for x in lst ]
BTW, I t