Commit 9d663b99 by BellCodeEditor

save project

parent f99ebf86
Showing with 18 additions and 14 deletions
a = []
while True:
try:
n=input("请输入")
if n=="q":
break
n=int(n)
except:
print("请输入整数")
print("程序结束")
else:
a.append(n)
print(a)
\ No newline at end of file
def num():
a = []
while True:
try:
n=input("请输入")
if n=="q":
break
n=int(n)
except:
print("请输入整数")
print("程序结束")
else:
a.append(n)
return a
b = num()
print(b)
\ 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