Commit 59c25f28 by BellCodeEditor

auto save

parent dc70412a
Showing with 25 additions and 0 deletions
def a():
total = []
while True:
unit=input("请输入:")
#赋值unit
if unit == 'q':
break
else:
try:
unit == int(unit)
#如果unit是整数
except:
print("请输入整数")
#报错后的程序
else:
total.append(int(unit))
print("已添加")
#如果程序不报错
for i in range(total):
b=b+i
print(total,b)
return total
c=a()
print(c)
\ 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