第二题:
def prod(L): return reduce(lambda x, y: x*y, L)
第三题:
def str2float(s): i = list(map(lambda x: DIGITS[x], s)) return float(reduce(lambda x, y: str(x) + str(y), i)) DIGITS = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '.': '.'}
我是傻逼,nmd第三题搞错了
Sign in to make a reply
用户7511049404
第二题:
第三题: