Commit 828b24d0 by BellCodeEditor

save project

parent d4832176
Showing with 5 additions and 7 deletions
def new_inpot(): def new_inpot():
total=[] total=[]
while True: while True:
try:
unit=input("请输入") unit=input("请输入")
except:
print("不是数字")
if unit=="q": if unit=="q":
break break
else: else:
try:
unit=int(unit)
except:
print("重输")
else:
total.append(unit) total.append(unit)
print(total) print(total)
new_inpot() new_inpot()
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