Created
August 9, 2016 03:18
-
-
Save Gwith/6deea2c29c67323aac9b71dac867370a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def addToInventory(inventory, addedItems): | |
| for item in addedItems: | |
| inventory = inventory.get(item, 0) + 1 | |
| print(inventory) | |
| inv = {'gold coin': 42, 'rope': 1} | |
| dragonLoot = ['gold coin', 'dagger', 'gold coin', 'gold coin', 'ruby'] | |
| addToInventory(inv, dragonLoot) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment