Keeping Track of the Produce


prices = {"banana":4, "apple":2, "orange":1.5, "pear":3}
stock = {"banana":6, "apple":0, "orange":32, "pear":15}
for fruta in stock:
print fruta
print "stock: %s" % stock[fruta]
print "price: %s" % prices[fruta] + " dollars"

What's wrong with orange people?


Maybe they eat too many carrots.

As for your code, compare your output to the described format.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.