Got stuck or is it bug?


#1

i got stuck in "8: keep track of the produce" lesson but i'm sure my code is right... it says "Oops, try again. Check what your code prints for orange. It doesn't look quite right! " here is my code..

prices = {
    "banana": 4,
    "apple": 2,
    "orange": 1.5,
    "pear": 3
    }
stock = {'banana': 6, 'apple': 0, 'orange': 32, 'pear': 15}
for price in prices:
    print "%s;" % price
    print "prices: %s" % prices[price]
    print "stock: %s" % stock[price]

#2

also tried this but its says i need atleast 3 prints..

prices = {
    "banana": 4,
    "apple": 2,
    "orange": 1.5,
    "pear": 3
    }
stock = {'banana': 6, 'apple': 0, 'orange': 32, 'pear': 15}
for price in prices:
    print price,"prices: %s," % prices[price],"stocks: %s." % stock[price]

#3

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