stuff = {'rope': 1, 'torch': 6, 'gold coin': 42, 'dagger': 1, 'arrow': 12}
def displayInventory(inventory):
print('Inventory:')
item_count = 0
for k, v in inventory.items():
print(k + ' -- ' + str(v))
item_count += v
print('Total number of items: ' + str(item_count))
displayInventory(stuff)
5.6.1 好玩游戏的物品清单
最新推荐文章于 2021-08-25 15:09:27 发布