Commit 21172865 by BellCodeEditor

save project

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