Commit 3aac58b1 by BellCodeEditor

save project

parent 36fc793e
Showing with 23 additions and 14 deletions
total = [] def ABC():
while True: total = []
unit= input("请输入:") while True:
if unit== 'q': unit= input("请输入:")
break if unit== 'q':
else: break
try:
unit=int(unit)
except:
print("错了")
else: else:
total.append(unit) try:
unit=int(unit)
except:
\ No newline at end of file print("错了")
else:
total.append(unit)
return total
b=ABC()
print(b)
def s(a):
count=0
for i in a:
count = count + i
return count
c=s(b)
print(c)
\ No newline at end of file
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