Check what your code prints for orange. It doesnt look quite right.?


#1



This is what i have for my code.

prices = {
"banana": 4,
"apple": 2,
"orange": 1.5,
"pear": 3   
}

stock = {
"banana": 6,
"apple": 0,
"orange": 32,
"pear": 15
}

for item in prices:
    print item
    print "Price:", prices[key]
    print "Stock:", stock[key]


#2

my output is this which looks correct..

orange
Price: 1.5
Stock:32
pear
Price: 3
Stock:15
banana
Price: 4
Stock:6
apple
Price: 2
Stock:0
None


#3

The SCT is expecting lowercase in your labels: price and stock.


#4

still the same when i change it


#5

It was the space after the Prices: .... i didnt have the space


#6

Thanks tons! I have to add this part to make the total 20 characters haha. But seriously thank you


#8

2 posts were split to a new topic: Stocking out - what's wrong with this code?


#9