What's wrong?


#1

prices = {'banana' :4,
'apple' :2,
'orange' :1.5,
'pear' :3}
stocks = {'banana' :6,
'apple' :0,
'orange' :32,
'pear' :15}
for key in prices:
print (key)
print ('price : %s' % prices[key])
print ('stock : %s' % stocks[key])

I typed this in and got the error
Oops, try again. Check what your code prints for orange. It doesn't look quite right!

my window showed
orange
price : 1.5
stock : 32
pear
price : 3
stock : 15
banana
price : 4
stock : 6
apple
price : 2
stock : 0
None

What did I do wrong?
I tried to refresh the page. It didn't work.


#2

It's about the way you write

You have to type it like in the example:

print ('price: %s' % prices[key])    
print ('stock: %s' % stocks[key])

no space between price and : same goes for stock and :

:smiley:


#3

Thanks for helping out.


#4

You're welcome :slightly_smiling: