Skip to content

Instantly share code, notes, and snippets.

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 python201807/dd1914354d5640d3b4f5c63cad48833e to your computer and use it in GitHub Desktop.
Save python201807/dd1914354d5640d3b4f5c63cad48833e to your computer and use it in GitHub Desktop.
def display_inventory(inventory):
print ('持ち物リスト:')
item_total = 0
for k, v in inventory.items():
print (str(inventory[k]) + ' ' + k)
item_total += v
print ('総アイテム数: ' + str(item_total))
stuff = {'ロープ':1,'たいまつ':6,'金貨':42,'手裏剣':1,'矢':12}
display_inventory(stuff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment