Commit 42f1f66c by BellCodeEditor

save project

parent d89bc8d7
Showing with 14 additions and 4 deletions
def forever():
def oo():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit=float(unit)
except:
print("输入整数")
else:
total.append(unit)
print(total)
forever()
\ No newline at end of file
return total
total=oo()
print(total)
a=0.0
for i in total:
a+=i
print(a)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment