print("subtract float")
ns = input().split("#")[0].split(",")
f = []
di = []
print(ns)
print("subtract directly")
for i in range(len(ns)):
f.append(float(ns[i]))
re = f[0]
for i in range(len(f)-1):
re -= f[i+1]
print(re)
if max(f) >= 1:
print("This program cant handle these numbers.\nThe numbers must be smaller than 1.")
else:
print("check digit")
for i in range(len(ns)):
ns[i] = ns[i].split(".")[1]
print(ns)
di.append(len(ns[i]))
times = max(di)
print("max digit> "+str(times))
for i in range(len(ns)):
ns[i] = int(ns[i][ns[i].rfind("0")+1:])*10**(times-di[i])
print(ns[i])
res = ns[0]
for i in range(len(ns)-1):
res -= ns[i+1]
print(res/10**times)
To embed this project on your website, copy the following code and paste it into your website's HTML: