1931黃海豐15
提問人:wx20211012145927發(fā)布時間: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的倍數(shù)
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的倍數(shù)
number = []
for i in range(3, 31):
if i % 3 == 0:
number.append(i)
for j in range(len(number)):
print(number[j], end=" ")
繼續(xù)查找其他問題的答案?
相關(guān)視頻回答
點擊加載更多評論>>