This file contains 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
stuff = {'rope': 1, 'torch': 6, 'gold coin': 42, 'dagger': 1, 'arrow': 12} | |
#def displayInventory(inventory): | |
# total_items = 0 | |
# for item in inventory: | |
# print(str(inventory[item])+' '+item) | |
# total_items += inventory[item] | |
# print("Total number of items: "+str(total_items)) | |
# This worked but I like the following better: |