KEEPING TRACK OF THE PRODUCE || "Oops, try again. Check what your code prints for orange. It doesn't look quite right!"


#1


So, I have been checking other topics about this problem and they do not seem to have the answer I am looking for. When I Save and Submit my code, I receive this error message:
"Oops, try again. Check what your code prints for orange. It doesn't look quite right!"


The program printed this:

"orange
Prices: 1.5
Stock: 32
pear
Prices: 3
Stock: 15
banana
Prices: 4
Stock: 6
apple
Prices: 2
Stock: 0
None"

I honestly see no problem with the results. 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 "Prices: %s" % prices[key]
    print "Stock: %s" % stock[key]

Can anybody help me? Thanks!


#2

the validitation of this exercise is really strict, it should be price instead of Prices and stock instead of Stock

the word has to be spelled right, and it is case sensitive.


#3

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