New python learner here and i encountered a problem where it says my dict is unhashable. I searched up this on stack overflow for other answers but i couldn't understand them well. Does any one have a explanation for what is unhashable that is easy to understand? Also here is the part of my code where things went wrong
for name1, itemdescription1 in thisitem.items():
if rooms[currentroom-1][currentroom]["items"][name1][itemdescription1] == "yes": # if player already got this item
print ("You didn't find anything")
on the middle line of the code above it says TypeError: unhashable type: 'dict' And here is my code for the
rooms = [
{1 : {
"name" : "hall",
"east" : 2,
"south" : 3,
"description" : "An empty hallway, nothing of use here. ",
"items" : {"torch" : {"a dim torch " : "no"}}
}},
{2 : {
"name" : "kitchen",
"west" : 1,
"east" : 4,
"south" : 6,
"description" : "An odd smell reeks from the kitchen. What could it be? ",
"items" : {"meat" : {"a piece of vile meat " : "no"}}
}},
{3 : {
"name" : "bedroom",
"north" : 1,
"east" : 6,
"description" : "A overwelmingly big room containing two gigantic beds, hmmm... ",
"items" : {"key" : {"a silver key " : "no"}}
}},
{4 : {
"name" : "diningroom",
"west" : 2,
"south" : 5,
"description" : "A large room with tables and chairs, nothing special. ",
"items" : {"plate" : {"a white plate " : "no"}}
}},
{5 : {
"name" : "bathroom",
"north" : 4,
"west" : 6,
"description" : "A creepy shadow lays in the bathtub, better go somewhere else. ",
"items" : {"shampoo" : {"a bottle of shampoo " : "no"}}
}},
{6 : {
"name" : "garage",
"north" : 2,
"west" : 3,
"east" : 5,
"description" : "It reeks of blood here. You wonder why. ",
"items" : {"bolts" : {"some rusted iron bolts " : "no"}}
}}
]