您的位置:首页 > 其它

第七章作业

2018-04-02 08:33 204 查看
#7-2
info=input("how many people do you have dinner with?\n")
num=int(info)
if num>8:
print("i am sorry that no table is left.\n")
else:
print("ok,there is a empty table.\n")

#7-3
info=input("input a number, i will tell you something\n")
if (int(info)%10==0):
print(info+" is integral multiple of 10.\n")
else:
print(info+" is not integral multiple of 10.\n")

#7--5
while True:
info=input("tell me your age and i will tell you ticket price, or input 'quit' to quit\n")
if (info=='quit'):
break
elif int(info)<3:
print("you don't have to pay for it.\n")
elif int(info)<=12:
print("you must pay 10 dollars for your ticket.\n")
else:
print("you must pay 15 dollars for your ticket.\n")

# 7-10
places=[]
while True:
info=input("If you could visit one place in the world,where would you go?(input'quit' to quit)\n")
if (info=='quit'):
break
else:
places.append(info)

print(places)


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  作业