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

Keith Winston keithwins at gmail.com
Tue Dec 31 22:09:03 CET 2013


Hi PierreD, I think if you iterate over your strings with something like
this, it will do what you want, if I understand correctly (snum is your
string number, like "123,321"):

fnum = float(snum.replace(",", ".")

keith: rank beginner, take everything with a grain of salt!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131231/1b3be777/attachment.html>


More information about the Tutor mailing list