Keeping Track of the Produce


#1

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?


#2

Maybe they eat too many carrots.

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


#3

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