Keeping track of the produce


#1

so guys i'm trying this code and keeps saying there's a problem..
it gets on my nerves..

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]

and the err

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

i have to say that i've already done that thing with the identication spaces


Keeping trace of product
#2

the spacing is not correct, first in this sentence:

print "prices:%s" % prices[key]

it should be price, not prices, and there is no space between price: and %s

the spacing in the sentence below is not better, %s is before the colon, instead of after


#3

2 posts were split to a new topic: Keeping trace of product


#5

Please no more i have the same problem replies, please make a new topic with the template provided so someone can actually help you, thank you for your understanding, see guidelines


#6

same problem..
and i don't get it why should i put price instead of prices.

i mean i'm just printing a string inside some quotes.. so this has nothing to do with affecting the code somehow..


#7

same answer, make your own topic.

Because the checking script on this exercise is strict, and want you to print exactly like in the output shown to you


#8

i'm the guy who started this topic.. so erhm do i have to make again a topic to say the same thing that i've already told?
haha


#9

does this:

answer why it should be price and not prices? it comes really strict to naming and spacing in this exercise


#10

ok done it and it worked.. thanks..you can close that topic if you want