Keeping track of the produce - A day at the supermarket


#1



I get a message saying "
Oops, try again. Check what your code prints for orange. It doesn't look quite right!"
Also, although i've included it in my code, what's the reason for typing "print key"? why is that necessary? especially if we're saying print price and print stock

I dont get whats wrong the info being printed for orange seems to be right?


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]


#2

price and stock should be lowercase, the output should be an exact match


#3

thankyou it worked! why lowercase though the example shows it in uppercase?


#4

that is just an example, the instructions:

clearly show they want the output in lowercase.


#5

A post was split to a new topic: Keeping trace of produce


#6