Commit af4483c1 by BellCodeEditor

save project

parent e12b8870
Showing with 24 additions and 15 deletions
total = [] def mysum(list):
def new_input(unit): sum=0
return int(unit) for n in list:
while True: sum+=n
unit= input("请输入:") return sum
if unit== 'q':
break
else:
try: def new_input():
unit = int(unit) total = []
except: while True:
print("使用有误") unit= input("请输入:")
if unit== 'q':
break
else: else:
total.append(unit) try:
print(total) unit = int(unit)
\ No newline at end of file except:
print("使用有误")
else:
total.append(unit)
print(mysum(total))
new_input()
\ 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