Commit 21172865 by BellCodeEditor

save project

parent 4f5255d2
Showing with 10 additions and 4 deletions
total = [] total = []
def new_input(): def new_input():
while True: while True:
try:
unit= input("请输入:") unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit=int(unit)
except: except:
print('要输入整数啊') print('请重新输入一个数字:')
else: else:
if int(unit) < 18: total.append(unit)
print('不可以喝酒') print('*'*30)
new_input() new_input()
print(total)
\ 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