Commit b4bf8c69 by BellCodeEditor

save project

parent dc70412a
Showing with 38 additions and 0 deletions
def a():
b =0
while True:
c=input("请输入(q退出):")
if c =="q":
break
else:
try:
c=int(c)
b+=c
except:
print("s")
print(b)
a()
\ No newline at end of file
def a():
b = []
while True:
c=input("请输入(q退出):")
if c =="q":
break
else:
try:
c=int(c)
b.append(c)
except:
print("s")
return b
a1=a()
print(a1)
def z(m):
n=0
for i in m:
n+=i
return n
h=z(a1)
print(h)
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