Commit 104231db by BellCodeEditor

save project

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