Keeping Track of the Produce


#1
for key in stock:
    print key
    print "price: %s" % prices[key]
    print "stock: %s" % stock[key]

Why does that work

for key in stock:
    print key
    print "prices: %s" % prices[key]
    print "stock: %s" % stock[key]

And this doesnt??! (Take note of "prices" and "price")


#2

@petras98: Most certainly it's the space between " : " and the placeholder, %s.


#3

well the thing is that it worked when i just got rid of the "s" on "prices" and didnt change the code for anything else.


#4

Oh, didn't know the s.
Glad you figured it out and fixed it!

Just make sure to follow the instructions and print exactly what they ask you to.


#5

Okay i will try to XD