Commit 02df8a6b by BellCodeEditor

save project

parent 73109b19
Showing with 18 additions and 13 deletions
total = [] def new_input():
while True: total = []
un=input("请输入:") while True:
if un == 'q': un=input("请输入:")
break if un == 'q':
try: break
unit=int(un) try:
except: unit=int(un)
print('只可以输入数字哦') except:
else: print('只可以输入数字哦')
total.append(unit) else:
print(total) total.append(unit)
\ No newline at end of file print(total)
print('-'*30)
return total
print('-'*30)
print('结果'+str(sum(new_input())))
\ 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