8. Keeping track of produce *orange problem


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

stock = {
    'banana': 6,
    'apple': 0, 
    'orange': 32,
    'pear': 15
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 "Price: %s" % prices[key]
    print "Stock: %s" % stock[key]

The error message reads : Check what your code prints for orange. It doesn't look quite right!
And I'm at a loss. Thanks in advanced.


The instructions are very specific.

02. 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.

Meaning, you need to lowercase your price and stock in your print statements.


OMG thank you so much!!!


Thanks bro. :slight_smile:


A post was split to a new topic: Still problem


please, anyone help me....even after lowercase its showing error.


can you please tell me how it is applied to that code??....i'm stucked!!!!



Please go here, press the make a new topic button, fill in the template (we need this information to help you), then someone will help you