Commit 782a7ea5 by BellCodeEditor

save project

parent 51458ba9
Showing with 11 additions and 10 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)
finally:
print('-'*30) print('-'*30)
print(a) return b
new_input() 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