Keeping track of produce


#1



Keeping track of produce

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


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

for fruit in price:
    print ("%s" % (fruit))
    print ("price :%s" % price[fruit])
    print ("stock :%s"  % stock[fruit])


#2

Be sure to use a prices dictionary, not price.


#3

same error !!
this is what the output looks like
orange
price :1.5
stock :32
pear
price :3
stock :15
banana
price :4
stock :6
apple
price :2
stock :0
None


#4


#5

For the sake of humoring the lesson checker, try using Python 2 print statements and don't format the first one.

print fruit
print "stock: %s" % stock[fruit]

and so on.


#6

still the same!!


#7

Be sure the colon is before the space, not after it.

"stock: %s"

#8

aha it worked.. so basically the space was counted..!!!!


#9

thank you ..very much for the advice..!!


#10

I'm having a similar issue on this lesson:


#11

you have to type "price" into print instead of "prices".. its stupid, I know


#12

Ahh I see, thank you!


#13

thanks........................


#14