Commit 9523a8a8 by BellCodeEditor

save project

parent 89079a45
Showing with 21 additions and 12 deletions
total = []
def luoyutaozuishuai(): def luoyutaozuishuai():
total = []
while True: while True:
unit=int(input("请输入:")) unit=input("请输入:")
if unit== 'q': if unit== 'q':
break break
else: else:
total.append(unit) try:
print(total) unit=int(unit)
try: except:
luoyutaozuishuai() print("请输入整数:")
except: else:
print("请输入整数:") print("已经加入")
else: total.append(unit)
print("已经加入") print(total)
print(total) return total
return(total) e=luoyutaozuishuai()
def sum(c):
sss=0
for i in c:
sss=sss+i
print(sss)
return sss
sum(e)
\ 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