Lesson 8


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/python-beginner-en-IZ9Ra/1/3?curriculum_id=4f89dab3d788890003000096
<In what way does your code behave incorrectly? Include ALL error messages.>
“Oops, try again.
Check what your code prints for orange. It doesn’t look quite right!”

<What do you expect to happen instead?>
Don’t see what’s wrong with my code, I’ve even tried refreshing, redoing it several times, and closing out code academy then logging back in.

``` 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 "prices %s" %price[key] print "stock %s" %stock[key]
<do not remove the three backticks above>

#2

Couple of problems, first one is here:

price[key]

there is no dictionary called price, it is called prices. Now the tricky bit, the string printed should be a exact match, what you have:

print "prices %s"
print "stock %s"

however, if you look in the instructions, the exercise ask you to print price: (without s, and wit colon). And after stock should also be a colon (see instructions). Triple check the string printed is an exact match as the exercise wants to have the output


#3

Thanks for the help. The whole price/prices thing was confusing me.


#4

I have done the same way. But i get an error :

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

#5

If you have a problem, please make your own topic with question + error message + code. This solution was specific for acoolilns.


#6