#7-1汽车租赁
#coding:gbk
#7-1汽车租赁
sorts = input("Please enter the kind of the car")
print('Let me see if I can find you a ' + sorts)
#7-2餐馆订位
number = input("Please enter the number of the catten")
number = int(number)
if number > 8:
print("Sorry, you need wait a monent!")
else:
print("There have free seat")
#7-3 10的整倍数
#7-4 披萨配料
topping = "Please enter some toppings"
toppings = ''
while toppings != 'quit': #先比较
toppings = input(topping)
if toppings !='quit':
print("Please adding some " + toppings)
#7-5电影票
prompt = 'Please enter your age: '
age = ''
while age != 'quit':
age = input(prompt)
if age == 'quit':
break
age = int(age)
if age < 3:
print("You are free to see the moive!")
elif age <=12:
print("Your cost is 10 $!")
else:
print("Your cost is 15$!")
#7-6三个出口
prompt = "Please enter topping:"
active = True
toppings = ""
while active:
toppings = input(prompt)
if toppings =='quit':
break
else:
print("Please adding som
Python编程从入门到实践第7章习题答案
最新推荐文章于 2022-04-15 16:49:14 发布
