8.keeping track of the produce


#1

prices = {“banana”: 4,“apple”: 2,“orange”:1.5,“pear”: 3}
stock = {“banana”: 6,“apple”: 0,“orange”: 32,“pear”: 15}
for keys in prices:
print keys
print “prices: %s” % prices[keys]
print “stock: %s” % stock[keys]

what’s wrong with my code?Check what your code prints for orange. It doesn’t look quite right!


#2

the output needs to be an exact match, the price information should have price: string in front of it, not prices:


#3

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