I am having the same trouble with the oranges


#1

Hi, I'm Penny.
I am having the same trouble with the oranges.
prices = {
"banana" : 4,
"apple" : 2,
"orange" : 1.5,
"pear" : 3
}
stock = {
"banana" : 6,
"apple" : 0,
"orange" : 32,
"pear" : 15
}
for fruit in prices:
print fruit
print "price:%s " % prices[fruit]
print "stock:%s " % stock[fruit]
The message keeps telling: Check what your code prints for orange. It doesn't look quite right!
it prints:
orange
price:1.5
stock:32
which looks right to me?


Welcome to our forums! Please Introduce Yourself
#2

Please create a new topic with that question and include your code, the error and lesson URL.
And Welcome!


#3

HI these lines

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

add a space after the : in both lines and remove the space after the %s


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.