Commit 59af40d7 by BellCodeEditor

save project

parent 17abe562
Showing with 8 additions and 3 deletions
...@@ -4,11 +4,15 @@ def new_input(): ...@@ -4,11 +4,15 @@ def new_input():
while True: while True:
try: try:
unit= input("请输入:") unit= input("请输入:")
if unit== 'q':
break
else:
int(unit)
total.append(unit)
except: except:
print('请输入数字!')
if unit== 'q':
break
else: else:
total.append(unit) total.append(unit)
new_input() new_input()
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