交作业
Topic sourcedef float(x): L1 = x[:x.index('.')] L2 = x[:x.index('.'):-1] def c2n(y): return {'1':1, '2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9, '0':0}[y] def fn(x,y): return x * 10 + y def fnn(x,y): return x / 10 + y return reduce(fn, map(c2n, L1)) + (reduce(fnn, map(c2n, L2)))/ 10
那个是dict【】索引的意思,我也是初学者:)
- 1
想睡觉的kira