Skip to content

Instantly share code, notes, and snippets.

@Gwith
Created August 8, 2016 19:42
Show Gist options
  • Save Gwith/81175616e2be9f4a4a1359c2f014dfbd to your computer and use it in GitHub Desktop.
Save Gwith/81175616e2be9f4a4a1359c2f014dfbd to your computer and use it in GitHub Desktop.
stuff = {'rope': 1, 'torch': 6, 'gold coin': 42, 'dagger': 1, 'arrow': 12}
def displayInventory(inventory):
print("Inventory:")
item_total = 0
for k, v in inventory.items():
print(v, k)
print("Total number of items: " + str(item_total))
displayInventory(stuff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment