Discuss / Python / 第三题

第三题

Topic source

__吖糖

#1 Created at ... [Delete] [Delete and Lock User]

def str2float(s): return reduce(lambda x,y:x10+y,map(int,s.replace('.','')))/(10*len(s[-s.index('.'):]))

__吖糖

#2 Created at ... [Delete] [Delete and Lock User]

显示*号

def str2float(s): return reduce(lambda x,y:x*10+y,map(int,s.replace('.','')))/(10**len(s[-s.index('.'):]))


  • 1

Reply