刘鸿辉
提问人:wx20211012145959发布时间:2021-10-19
# 公园门票
while True:
age = input("请输入游客年龄:")
if age == 'quit':
break
elif int(age) > 12:
print("您的门票价格为15元")
elif 3 <= int(age) <= 12:
print("您的门票价格为10元")
elif int(age) < 3:
print("您无需门票")
# 列表使用
names = ['张三', '李四', '王五', '赵六']
for i in names:
print(i)
for j in names:
print(f'你好呀!{j}')
# 3的倍数
number = []
for i in range(3, 31):
if i % 3 == 0:
number.append(i)
for j in range(len(number)):
print(number[j], end=" ")
while True:
age = input("请输入游客年龄:")
if age == 'quit':
break
elif int(age) > 12:
print("您的门票价格为15元")
elif 3 <= int(age) <= 12:
print("您的门票价格为10元")
elif int(age) < 3:
print("您无需门票")
# 列表使用
names = ['张三', '李四', '王五', '赵六']
for i in names:
print(i)
for j in names:
print(f'你好呀!{j}')
# 3的倍数
number = []
for i in range(3, 31):
if i % 3 == 0:
number.append(i)
for j in range(len(number)):
print(number[j], end=" ")
继续查找其他问题的答案?
相关视频回答
回复(0)
点击加载更多评论>>