PHP Code:
#! /usr/bin/python
pizza_order = []
pizza_tally = 0
count = True
while count == True:
pizza = raw_input("What type of pizza do you want?")
if pizza != "":
pizza_order.append(pizza)
else:
count = False
print "You ordered ", len(pizza_order)
for p in pizza_order:
print p
This doesn't tally the price, but gives shows how to add pizzas to a order, and calculate the total amount, and access each one.
If you want to tally prices, it depends on how the pricing works. If every pizza is the same price, all you need is the length and the ability to multiply.
I have a feeling what you have in mind doesn't involve pizza's and this was an example.
Bookmarks