inventory = {
'gold' : 500,
'sack' : ['rock', 'copper wire'],
'weapons rack' : ['pistol', 'MP-5', 'grenade'],
'ammo pouch' : ['Pistol ammo', 'MP-5 ammo'],
}
print "You have " + inventory['gold'][0] + " coins!"
I get the error message:
line 8, in <module>
print "You have " + inventory['gold'] + " coins!"
TypeError: 'int' object has no attribute '__getitem__'
why wouldn't the console print out "You have 500 gold coins!"