Commit 4913b709 by BellCodeEditor

save project

parent 54bc9bce
Showing with 8 additions and 3 deletions
...@@ -2,10 +2,15 @@ def new_input(): ...@@ -2,10 +2,15 @@ def new_input():
total = [] total = []
sum = 0 sum = 0
while True: while True:
unit= input("请输入:") try:
if unit== 'q': unit= input("请输入:")
break if unit== 'q':
break
except:
print("请输入整数!")
else: else:
if unit=='q':
break
total.append(unit) total.append(unit)
sum +=int(unit) sum +=int(unit)
print(total) print(total)
......
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