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


#1



https://www.codecademy.com/courses/python-beginner-en-IZ9Ra/1/3?curriculum_id=4f89dab3d788890003000096

It prints:
"orange
Price: 1.5
Stock: 32
pear
Price: 3
Stock: 15
banana
Price: 4
Stock: 6
apple
Price: 2
Stock: 0
None"

And I get the errormessage: Oops, try again. Check what your code prints for orange. It doesn't look quite right

That It would be green, and accept the output.


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 "Price: %s" % prices[key]
    print "Stock: %s" % stock[key]


#2

Print the answer in the following format:
apple
price: 2
stock: 0
so lowercase Price and Stock


#3

I am printing this answer but got same message
Oops, try again. Check what your code prints for orange. It doesn't look quite right!


#4

can you write code !


#5

Put a space in between :%s for price and stock. should fix


#6

I have already put space
Please check my code
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" % prices[key]
print "stock : %s" % stock[key]


#7

i got the solution
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 "price: %s" % prices[key]
print "stock: %s" % stock[key]


#8

For me, was the same problem. Thanks for your solution. =)