Discuss / Python / 第一次交作业

第一次交作业

Topic source

忑啦米

#1 Created at ... [Delete] [Delete and Lock User]
在此插入代码

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')


  • 1

Reply