Commit 68338cdf by BellCodeEditor

save project

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