Commit 68338cdf by BellCodeEditor

save project

parent 104231db
Showing with 8 additions and 16 deletions
def myinput(): #定义一个函数,叫myinput listA = [11,15,40,0,30,5,12,46]
zongjia=0 def ff(li):
total = [] #定义一个列表,叫total icount = 0
while True: for i in li:
b=0 icount += i
unit= input("请输入:") return icount
try: a = ff(listA)
b=int(unit) print(a)
zongjia+=b
except:
if (unit == 'q'):
return zongjia
else:
total.append(unit)
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