作业三:
x = s.split('.')
p = 0
xx = list(map(int, x[1]))
for i in range(len(xx)):
p = xx[i]/(10 ** (i+1)) + p
x[1] = p
def f(z, y):
return z+y
L1 = list(map(float, x))
print(L1)
L2 = reduce(f, L1)
return L2
Sign in to make a reply
用户7606739003
作业三:
x = s.split('.')
p = 0
xx = list(map(int, x[1]))
for i in range(len(xx)):
p = xx[i]/(10 ** (i+1)) + p
x[1] = p
def f(z, y):
return z+y
L1 = list(map(float, x))
print(L1)
L2 = reduce(f, L1)
return L2