706193107杜江紅10月16
提問人:wx20211012145951發(fā)布時間:2021-10-19
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("程序結(jié)束")
# 上機練習3:3的倍數(shù)
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)
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("程序結(jié)束")
# 上機練習3:3的倍數(shù)
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)
繼續(xù)查找其他問題的答案?
相關視頻回答
點擊加載更多評論>>