I'm confused


#1

I don't know what is wrong with my program, but it just prints the whole list, and then says that "orange seems off"

it just doesn't seem to work with the for loop, can someone tell me what is wrong.

prices = {"banana": 4,"apple": 2, "orange": 1.5, "pear": 3} 
stock = {"banana": 6,"apple": 0, "orange": 32, "pear": 15}

for Item in prices:
    print prices
    print "price" , prices[Item]
    print "stock" , stock[Item]


#2

should say print
"price: "
and stock should look like
print "stock: "

with the colon and space before the closing quotes.


#3

i am afraid you can't use ,, either use + to concatenate the string and variable or use %s like in the example of the exercise.

also, your colons after price and stock are missing


#4

the , will add the space, but it won't work.


#5

You're right, I wasn't paying attention to that, the %s is needed. Concatenation could work too.


#6

Hi @rozzerz ,

Why are you displaying the entire prices dictionary here? ...

print prices

#7

Its alright, I solved it about 5 mins after posting


#8