Commit 782a7ea5 by BellCodeEditor

save project

parent 51458ba9
Showing with 12 additions and 11 deletions
def new_input(): def new_input():
a=[] b=[]
while True:#获取输入内容 while True:
x=input('输入,q退')#如果输入的是q a=input('输入,q退')
if x=='q': if a=='q':
break break
else: else:
try: try:
x=int(x) a=int(a)
except: except:
print('重输') print('重输')
except: else:
a.append(x) b.append(a)
print('-'*30) finally:
print(a) print('-'*30)
new_input() return b
result=new_input()
print(result)
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