曹清緣 1931 03 10.16
while True:
age = input("請(qǐng)輸入你的年齡:")
if age == 'quit':
break
elif int(age)<3:
print("門票免費(fèi)")
elif int(age)>=3 and int(age)<=12:
print("門票10")
elif int(age) > 12:
print("門票15")
print("程序結(jié)束")
# 上機(jī)練習(xí)3:3的倍數(shù)
import random
a = list(range(3,31,3))
for i in a:
print(a)
# 上機(jī)練習(xí)1:列表的使用
names = ['王某','趙某','龍某','周某','伍某','曹某']
for i in names:
print("%s"%i,end=' ')
print("--------------")
#2
for a in names:
print("Hello %s"%a)
點(diǎn)擊加載更多評(píng)論>>