10.18作業(yè) 唐永欣
提問(wèn)人:qq20211012150057發(fā)布時(shí)間:2021-10-18
# 3的倍數(shù)
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 = '完成后請(qǐng)輸入’quit‘。'
print(ts)
xw = '請(qǐng)輸入你的年齡:'
while True:
age = input(xw)
if age == 'quit':
break
else:
age = int(age)
if age < 3:
print("您不需要買票!")
elif(age >= 3 and age <= 12):
print('您的票價(jià)為10元!')
else:
print('您的票價(jià)為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 = '完成后請(qǐng)輸入’quit‘。'
print(ts)
xw = '請(qǐng)輸入你的年齡:'
while True:
age = input(xw)
if age == 'quit':
break
else:
age = int(age)
if age < 3:
print("您不需要買票!")
elif(age >= 3 and age <= 12):
print('您的票價(jià)為10元!')
else:
print('您的票價(jià)為15元!')
繼續(xù)查找其他問(wèn)題的答案?
相關(guān)視頻回答
點(diǎn)擊加載更多評(píng)論>>