Keeping up with produce: i dont get whats wrong


#1



prices = {
"banana": 4,
"apple": 2,
"orange": 1.5,
"pear": 3
}

stock = {
"banana": 6,
"apple": 0,
"orange": 32,
"pear": 15
}

for key in prices:
print "price: %" (% prices[key])
print "stock: %" (% stock[key])


it keeps telling me that i have an incomplete format.

i expect it to work!!!!!!!!


Replace this line with your code.


#2

Hi, @shrutibala ,

Something is missing in the format string here, and in the next line ...

print "price: %" (% prices[key])

For example, the format string, "price: %", needs an s after the %.

You should also format your code when you post it. See How do I format code in my posts?.


#3

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