O'Reilly logo
  • Longxiang Lyu thinks this is interesting:

7-4. Pizza Toppings:


Cover of Python Crash Course


prompt = 'please enter the topping you want, enter "quit" to end the program:' toppings = []

while True: print(prompt) tpp = raw_input() if tpp == 'quit': break toppings.append(tpp)

prompt = '\nSelected topping' if len(toppings) > 1: prompt += 's:' else: prompt += ':'

print(prompt) for tpp in toppings: print(tpp)