Please help me with error "Check what your code prints for orange"


for p in prices:
if p == "apple":
print "apple"
print "price: %s" % prices["apple"]
print "stock: %s" % stock["apple"]

Replace this line with your code.


you use a loop, so you can print the product name, price and stock for all items in the dictionary.

Change the code, so it works for all products, not just apples


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