Unit 5: Lists and dictionaries - A Day at the Super Market - keeping track of produce


#1


Unit 5: Lists and dictionaries - A Day at the Super Market - keeping track of produce

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


In the instructions the code looks like this

apple
price: 2
stock: 0
I wanted the code to look like this so I can complete this unit


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 "cost: ", prices[key]
    print "stock: ", stock[key]


#2

problem here:

print "cost: ", prices[key]

you use cost, it should be price. also, using , will cause a space in the string so currently you have:

price:__2

(i replaced the spaces with underscores, so you can see the spaces), one space is enough. this goes for price and stock, the printout has to be an exact match


#3

print "face" + ""palm lolol