实际使用时,这样应该不好吧
DIGITS = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9} return reduce(lambda x, y:x * 10 + y, map(lambda x:DIGITS[x], s.split('.')[0])) + reduce(lambda x, y:x * 10 + y, map(lambda x:DIGITS[x], s.split('.')[1])) / (10 ** len(s.split('.')[1]))
Sign in to make a reply
风袭6729
实际使用时,这样应该不好吧