#7-2
num = input("how many people for dinner:")
num = int(num)
if num > 8 :
print("there is no available table.\n")
#7-3
num = input("please input a numble:");
if int(num) % 10 == 0 :
print("it is the times of 10")
else :
print("it is not the times of 10")
#7-5
age = input("how old are you?")
age = int(age)
if age < 3:
print("you don't need to pay for your tickets.")
elif age >= 3 and age <= 12 :
print("you should pay 10 dollars")
else:
print("you should pay 15 dollars")
#7-8
sandwich_orders = ["tuna", "pastrami"]
finish_sandwiched = []
while sandwich_orders :
sandwich = sandwich_orders.pop()
finish_sandwiched.append(sandwich)
for sandwich in finish_sandwiched:
print(sandwich)
python学习第4周(1)
最新推荐文章于 2018-06-20 01:58:34 发布