课后题打卡
# python编程快速上手 P93 好玩游戏的物品清单
def displayInventory(dict1): # 不用什么符号来特殊标记dict
print('Inventory:')
num = 0
for k,v in dict1.items():
print(v, ' ', k)
num += v
print('Total number os items: ',num)
dict2={'rope':1, 'torch':6, 'gold coin':42, 'dagger':1, 'arrow':12}
displayInventory(dict2)