Commit 8fe2b364 by BellCodeEditor

save project

parent 6bc827bd
Showing with 15 additions and 12 deletions
try: def new_input()
age = int(input('你今年几岁了?')) total=
except: \ No newline at end of file
print('要输入整数啊')
else:
if age < 18:
print("不可以喝酒")
print('程序结束~~')
\ No newline at end of file
def minecraft(): def new_input():
total = [] total = []
while True: while True:
unit= input("请输入:按q退出") unit= input("请输入:按q退出")
if unit== 'q': if unit== 'q':
break break
else: else:
total.append(unit) try:
unit = int(unit)
except:
print("请输入一个数字")
else:
toal.append(unit)
print("-"*30)
print(total) print(total)
minecraft() 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