def str2float(s): def multi(x, y): return x * 10 + y L1, L2 = s.split('.') return reduce(multi, map(int, L1)) + reduce(multi, map(int, L2)) * pow(0.1, len(L2))
Sign in to make a reply
If you like