Skip to content

Instantly share code, notes, and snippets.

@nharrell04
Created March 27, 2013 03:13
Show Gist options
  • Save nharrell04/5251304 to your computer and use it in GitHub Desktop.
Save nharrell04/5251304 to your computer and use it in GitHub Desktop.
I'm not sure why this works, particularly line 8. I guess expected to need another for loop to run through stock.
prices = {"banana" : 4, "apple" : 2, "orange" : 1.5, "pear" : 3}
stock = {"banana":6, "apple": 0, "orange": 32, "pear" : 15}
for z in prices:
print z
print "prices: "+ str(prices[z])
print "stock: "+ str(stock[z])
print
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment