Cannot understand where the mistake is


Hey guys,

I hope everyone is doing great.

I am stuck on the ‘keeping track of the produce’ task. Here is my code:

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]

And below you can see my output:

Price: 1.5
Stock: 32
Price: 3
Stock: 15
Price: 4
Stock: 6
Price: 2
Stock: 0

Everything looks correct to me but the program keeps saying ‘Check what your code prints for orange. It doesn’t look quite right!’. The prices and quantities seem to be correct. What am I doing wrong here?

Thanks in advance for the help.


Never mind, I got it to work!


me too ! i don`t know how to meke it right


Can you explain how you were able to fix this error? I am getting the same one.


try %d instead of %s. For int instead of str.


Thank you! Unfortunately, it still is not working. The same error comes up…


Maybe you shouldn’t capitalize “Price” (should be “price”) and “Stock”(should be “stock”) like it is in the directions. That might be the problem.


ok i had the same problem, the solution is simple
Simpy change the capital P an S in to small p and s in Price and Stock
print 'Price: %s’ % prices[key]
print ‘Stock: %s’ % stock[key]