while True:
age = input("请输入你的年龄:")
if age == 'quit':
break
elif int(age)<3:
print("门票免费")
elif int(age)>=3 and int(age)<=12:
print("门票10")
elif int(age) > 12:
print("门票15")
print("程序结束")
# 上机练习3:3的倍数
import random
a = list(range(3,31,3))
for i in a:
print(a)
# 上机练习1:列表的使用
names = ['小明','亚轩','小刘','小贺','小马哥','小严']
for i in names:
print("%s"%i,end=' ')
print("--------------")
#2
for a in names:
print("Hello %s"%a)
点击加载更多评论>>