Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created November 28, 2016 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/b732435c05674085471d658e7417e868 to your computer and use it in GitHub Desktop.
Save codecademydev/b732435c05674085471d658e7417e868 to your computer and use it in GitHub Desktop.
Codecademy export
prices = {
"banana" : 4,
"apple" : 2,
"orange" : 1.5,
"pear" : 3,
}
stock = {
"banana" : 6,
"apple" : 0,
"orange" : 32,
"pear" : 15,
}
for key in prices:
print key
print "price: %s" % prices[key]
print "stock: %s" % stock[key]
total = 0
for key in prices:
print prices[key] * stock[key]
total = total + (prices[key] * stock[key])
print total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment