10.18作业 唐永欣
提问人:qq20211012150057发布时间:2021-10-18
# 3的倍数
for i in range(3,31):
if i % 3 == 0:
names = ['张三','李四','王明','李娟','张芸']
print(names[0])
print(names[1])
print(names[2])
print(names[3])
print(names[4])
for name in names:
ts = '完成后请输入’quit‘。'
print(ts)
xw = '请输入你的年龄:'
while True:
age = input(xw)
if age == 'quit':
break
else:
age = int(age)
if age < 3:
print("您不需要买票!")
elif(age >= 3 and age <= 12):
print('您的票价为10元!')
else:
print('您的票价为15元!')
for i in range(3,31):
if i % 3 == 0:
print(i,end=' ')
names = ['张三','李四','王明','李娟','张芸']
print(names[0])
print(names[1])
print(names[2])
print(names[3])
print(names[4])
for name in names:
print(f'你好,{name}。')
ts = '完成后请输入’quit‘。'
print(ts)
xw = '请输入你的年龄:'
while True:
age = input(xw)
if age == 'quit':
break
else:
age = int(age)
if age < 3:
print("您不需要买票!")
elif(age >= 3 and age <= 12):
print('您的票价为10元!')
else:
print('您的票价为15元!')
继续查找其他问题的答案?
相关视频回答
回复(0)
点击加载更多评论>>