Keeping Track of the Produce


#1

prices = {
"banana": 4,
"maca": 2,
"laranja": 1.5,
"pera": 3,
}

stock = {
"banana": 6,
"maca": 0,
"laranja": 32,
"pera": 15,
}

for item in prices:
print "maca"
print "prices %s" % prices[item]
print "stock %s" % stock[item]

Error: "Oops, try again. Check what your code prints for pera. It doesn't look quite right!"

Why?


#2

price should be singular.

print "price: %s" ...

print "stock: %s" ...

#3

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