Commit 1ee22f8c by BellCodeEditor

auto save

parent 71f0f485
Showing with 8 additions and 2 deletions
...@@ -6,8 +6,13 @@ def new_input(): ...@@ -6,8 +6,13 @@ def new_input():
if unit== 'q': if unit== 'q':
break break
else: else:
total.append(unit) try:
sum += int(unit) #sum = sum+unit unit=int(unit)
except:
print("请输入整数!")
else:
total.append(unit)
sum += unit #sum = sum+unit
print(total) print(total)
print(sum) print(sum)
new_input() 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