Commit b8153516 by BellCodeEditor

save project

parent 024fb164
Showing with 10 additions and 1 deletions
...@@ -4,5 +4,13 @@ while True: ...@@ -4,5 +4,13 @@ while True:
if unit== 'q': if unit== 'q':
break break
else: else:
total.append(unit) try:
total.append(int(unit))
except:
print("输入错误,请重新输入一个数字")
unit= input("请输入:")
print("-"*30)
total.append(int(unit))
else:
print("-"*30)
print(total) print(total)
\ 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