I am trying to get my program to print out \"banana\" from the dictionary. What would be the simplest way to do this?
\"banana\"
This is my dictionary:
Use a for loop that ranges through all keys in prices:
prices
for key, value in prices.items(): print key print "price: %s" %value
Make sure that you change prices.items() to prices.iteritems() if you're using Python 2.x
prices.items()
prices.iteritems()