廖雪峰python教程上的习题
map/reduce
1 |
def (name): |
1 |
def prod(L): |
第三题
1
1 |
DIGITS = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '.':'.'} |
2
1 |
return reduce(lambda x,y: x*10 + y,map(int,s.split('.')[0])) + reduce(lambda x,y: x/10 + y,list(map(int,s.split('.')[1]))[::-1])/10 |
近期评论