A Day at the supermarket - where is the problem? I'm near to solving it


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

Should say: Done. Move on to the next lesson.
Where am I going wrong? Shouldn't I scan for everything and it finds me stock and prices? I'm stumped. Doesn't look like there is a problem.

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 'stock: %s' % stock[key]
    print 'prices: %s' % prices[key]


price should be singular, not plural, in the string.

the output called for is very specific


you should print the price fist and then the stock

also, it should be price, not prices


actually i thought that price should come first as well, but when i tested it with stock first, that worked too, so the only real issue is that price is prices.


for an exercise that is so strict in the validation, that come as a surprise.


Wow that was a quick reply. Thanks guys, plural problem fixed!


sometimes you get lucky if there are helpers online. Plus you made a good topic (exercise url, code (with markup), error message) makes our job a lot easier (and as reward you get faster help :slight_smile:

Good you got it fixed :slight_smile:


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