题解 | #披萨店的订单#
披萨店的订单
http://www.nowcoder.com/practice/22ed6ddd17834168b9000a9a94c243da
NP38 披萨店的订单
思路:
step1:使用len()函数判断列表是否为空;
代码如下:
pizza_orders = ['chichen','bacon','durian']
finished_pizza = []
while len(pizza_orders) > 0:
pizza = pizza_orders.pop()
print('I made your {} pizza!'.format(pizza))
finished_pizza.append(pizza)
print(finished_pizza)