Stuck at A Day at the Supermarket Part 8 in python


I'm not having any errors, syntactical or any other. It just said:
Oops, try again. Check what your code prints for orange. It doesn't look quite right!

It says it doesn't print the right thing I guess.

prices = {
stock = {
for x in stock:
    print x
    print 'price:', prices[x]
    print 'stock:', stock[x]


I tested your code and got the same error message. It would appear we need to use string formatting:

    print 'price: %s' % prices[x]
    print 'stock: %s' % stock[x]


ok.. thanks..
But I hope there is nothing wrong in printing it the way I did it right?


It's not wrong if Python doesn't burp. Once you move on to Python 3 (which I have yet to do) you will find that print() looks like a function, parens are required, and the old %s formatting is replaced with a .format() function.


thanks a lot........