Commit 42f1f66c by BellCodeEditor

save project

parent d89bc8d7
Showing with 14 additions and 4 deletions
def forever(): def oo():
total = [] total = []
while True: while True:
unit= input("请输入:") unit= input("请输入:")
if unit== 'q': if unit== 'q':
break break
else: else:
try:
unit=float(unit)
except:
print("输入整数")
else:
total.append(unit) total.append(unit)
print(total) return total
forever() total=oo()
\ No newline at end of file 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