Created
July 2, 2018 07:56
-
-
Save python201807/dd1914354d5640d3b4f5c63cad48833e to your computer and use it in GitHub Desktop.
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
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