Commit 9523a8a8 by BellCodeEditor

save project

parent 89079a45
Showing with 19 additions and 10 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()
except:
print("请输入整数:") print("请输入整数:")
else: else:
print("已经加入") print("已经加入")
print(total) total.append(unit)
return(total) print(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