8. keeping track of produce, A Day at the Supermarket - PLS HELP


why the error? whats wrong?

prices = {"banana": 4,
"apple": 2,
"orange": 1.5,
"pear": 3}

stock = {"banana": 6,
"apple": 0,
"orange": 32,
"pear": 15}

for key in prices:
print key
print "prices: %s" % prices[key]
print "stock: %s" % stock[key]


prices: 1.5
stock: 32
prices: 3
stock: 15
prices: 4
stock: 6
prices: 2
stock: 0


Oops, try again. Check what your code prints for orange. It doesn't look quite right!


Loop through each key in prices.
Like the example above, for each key, print out the key along with its price and stock information. Print the answer in the following format:
price: 2
stock: 0
Like the example above, because you know that the prices and stock dictionary have the same keys, you can access the stock dictionary while you are looping through prices.

When you're printing, you can use the syntax from the example above.


please copy paste your code to the forum, image upload seems to be very slow of late


done... would you be so kind to look at the code?


you have prices, this should be price


works, thank you!!!!