Commit 7e05739e by BellCodeEditor

save project

parent 683878a6
Showing with 10 additions and 9 deletions
def new_input(): def new_input():
total = [] total = []
while True: while True:
...@@ -6,10 +5,12 @@ def new_input(): ...@@ -6,10 +5,12 @@ def new_input():
if unit=='q': if unit=='q':
break break
else: else:
total.append(unit) try:
try: unit=int(unit)
new_input() except:
except: print('请输入数字')
print('请输入数字') else:
else: total.append(unit)
print(total) print('_'*30)
\ No newline at end of file print(total)
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