Commit b6ff4639 by BellCodeEditor

auto save

parent 18ad0ac0
Showing with 4 additions and 4 deletions
def new_input():
def new_input():#函数的定义,相当于把书放进书包里
total = []
while True:
unit = input('请输入(q退出):')
if unit == 'q':
break
else:
try:
try:#提醒用户输入数字
unit = int(unit)
except:
print("请重新输入一个数字")
......@@ -13,4 +13,5 @@ def new_input():
total.append(unit)
print("-"*30)
print(total)
new_input()
\ No newline at end of file
new_input() #函数的调用,相当于背起书包去上学
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