Home

Hi,

i have strings which look like money values (ie 34.45)
is there a way to convert them into float variables?
everytime i try I get this error: "numb = float(my_line) ValueError:
empty string for float()"
"
here's the code

************

import sys
import re

for line in sys.stdin.readlines():
my_line = line.rstrip()
numb = float(my_line)
print numb

previous
next

Re: new object declaration
Re: C++ template metaprogramming in C#?
Re: Python "implements <interface>" equivalent?
Re: Template specialisation with multiple typenames
Re: Ligmail bug?
Fundacja Hobbit
Akogo
Kidprotect
Dzieci Niczyje
Krwinka