Skip to content

Instantly share code, notes, and snippets.

@Gwith
Created August 9, 2016 02:59
Show Gist options
  • Select an option

  • Save Gwith/e13958049a0e8470ae1bcfd01cda1a4c to your computer and use it in GitHub Desktop.

Select an option

Save Gwith/e13958049a0e8470ae1bcfd01cda1a4c to your computer and use it in GitHub Desktop.
inventory = {'gold coin': 42, 'rope': 1}
addedItems = ['gold coin', 'dagger', 'gold coin', 'gold coin', 'ruby']
for item in addedItems:
inventory[item] += item
print(inventory)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment