This should work, any suggestions?


#1

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

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

for x in prices:
print x
print "price:", prices[x]
print "stock:", stock[x]


#2

Python 2.7.x does not print multiple comma separated values. It does print very nicely using a string format:

print "price: %s" % prices[x]