[Tutor] ValueError: could not convert string to float: '13,2'

Keith Winston keithwins at gmail.com
Tue Dec 31 22:15:49 CET 2013


Playing with this, a list comprehension is perfect:

fnumlist = [float(num.replace(",", ".")) for num in snumlist]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131231/3f547a0e/attachment.html>


More information about the Tutor mailing list