def str2num(s): return {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9':9}[s] pp = s.index('.') ss = s[:pp] + s[pp+1:] result = reduce(lambda x, y: x * 10 + y, map(str2num,ss)) return result / (10**len(s[pp+1:]))
请问ss = s[:pp] + s[pp+1:] 是什么意思
'123'+'456'拼接字符串
Sign in to make a reply
不知不觉w