# 7-2 num = input("How many people do you have?") num = int(num) if (num >= 8): print("Sorry, there are no desk available.") else: print("Welcome. This way please.") # 7-5 while True: age = input("Please input your age:") age = int(age) if (age <= 3): print("Free ticket!") if (age <= 12): print("10 dollors") if (age > 12): print("15 dollars") # 7-6-1 age = input("Please input your age:") while age!= 'quit': age = int(age) if (age <= 3): print("Free ticket!") if (age <= 12): print("10 dollors") if (age > 12): print("15 dollars") age = input("Please input your age:") # 7-6-2 active = True while Active: age = input("Please input your age:") if(age == 'quit'): active = True else: age = int(age) if (age <= 3): print("Free ticket!") if (age <= 12): print("10 dollors") if (age > 12): print("15 dollars") # 7-6-3 while True: age = input("Please input your age:") if(age == 'quit'): break; age = int(age) if (age <= 3): print("Free ticket!") if (age <= 12): print("10 dollors") if (age > 12): print("15 dollars") # 7-7 while True: print(111)
3.26python作业
最新推荐文章于 2020-12-17 13:54:36 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)