在此插入代码
from functools import reduce def str2float(s): def f(x,y): return x10+y n=index('.') s1=map(int,s[:n]) s2=map(int,s[n+1:]) return reduce(f,s1)+reduce(f,s2)/10*len(s[n+1:]) print('123.45641564')
Sign in to make a reply
忑啦米
from functools import reduce def str2float(s): def f(x,y): return x10+y n=index('.') s1=map(int,s[:n]) s2=map(int,s[n+1:]) return reduce(f,s1)+reduce(f,s2)/10*len(s[n+1:]) print('123.45641564')