Commit dbe856d2 by BellCodeEditor

save project

parent b2655eff
Showing with 4 additions and 0 deletions
...@@ -2,8 +2,12 @@ def a(): ...@@ -2,8 +2,12 @@ def a():
total = [] total = []
while True: while True:
unit= input("请输入:") unit= input("请输入:")
try:
if unit== 'q': if unit== 'q':
break break
else: else:
total.append(unit) total.append(unit)
except:
print("输入整数")
else:
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