高级编程技术第七次作业
2018-03-27 23:37
267 查看
第七章 用户输入和while循环
7-1 汽车租赁car = input("Which car do you want to buy?") print ("Let me see if I can fond you a " + car)
7-2 餐馆定位
number = input("How many people will have the meal? ") number = int(number) if number > 8: print ("There are no available table for having meal")
7-3 10的整数倍
num = input("Please input a number: ") num = int(num) if num % 10 == 0: print ("The number is a multiplier of ten") else: print ("The number is not a multiplier of ten")
7-4 比萨配料
while True: ingredient = input("Please input a pizza ingredient: ") if ingredient == "quit": break; print ("We will add the ingredient to your pizza")
7-5 电影票
while True: age = input("What is your age? ") age = int(age) if age <= 3: print ("Free") elif age <=12: print ("10 dollars") else: print ("15 dollars")
7-7 无限循环
print ("It is an infinite loop") while True: number = input("Please input a number you like: ") print ("Your number is " + number)
7-8 熟食店
sandwish_orders = ["A_sandwish", "B_sandwish", "C_sandwish", "D_sandwish"] finished_sandwish = [] while sandwish_orders: print ("I made your " + sandwish_orders[0]) finished_sandwish.append(sandwish_orders[0]) del sandwish_orders[0] print ("All sanwishes have been finished") print (finished_sandwish)
相关文章推荐
- 高级编程技术(第七次作业)
- 高级编程技术第七次作业
- 【高级编程技术】【作业】【第二周】【1】
- 高级编程技术第二周平时作业(2)
- 高级编程技术第三次作业
- 吉软-java-第七次作业
- 高级编程技术作业(第五、六章)
- 算法与数据结构第七次作业 太阳帝国
- 高级编程技术作业第四周 第七章课后练习
- [C++]第七次作业:实现一个大整数类BigInt
- 0710 第七次作业(双色球)
- C语言第七次博客作业--一二维数组
- Java第七次作业
- 高级编程技术_课后作业(一)
- 第七次作业 信息安全、评估、密码技术
- 高级编程技术第二次作业
- 第七次课程作业——派生类与简单工厂的实现
- 第七次课程作业
- 高级编程技术(Python)作业1
- 第七次作业