Commit 104231db by BellCodeEditor

save project

parent f8f4e394
Showing with 6 additions and 3 deletions
total = [] #定义一个列表,叫total
def myinput(): #定义一个函数,叫myinput def myinput(): #定义一个函数,叫myinput
zongjia=0
total = [] #定义一个列表,叫total
while True: while True:
b=0 b=0
unit= input("请输入:") unit= input("请输入:")
try: try:
b=int(unit) b=int(unit)
zongjia+=b
except: except:
if (unit == 'q'): if (unit == 'q'):
return return zongjia
else: else:
total.append(unit) total.append(unit)
myinput() y=myinput()
print(total) print(total)
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