Commit bc84fdca by BellCodeEditor

save project

parent b9c2f0c7
Showing with 11 additions and 1 deletions
...@@ -3,6 +3,15 @@ total = [] ...@@ -3,6 +3,15 @@ total = []
def hahaha(): def hahaha():
while True: while True:
unit= input("请输入:") unit= input("请输入:")
try:
int(unit)
except:
print("输入错误,请重新输入一个数字")
else:
if unit== 'q':
break
else:
total.append(unit)
print(total)
hahaha() hahaha()
\ 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