Reputation: 29767
I have the following dictionary:
equipment_element = {'equipment_name', [0,0,0,0,0,0,0]}
I can't figure out what is wrong with this list?
I'm trying to work backwards from this post Python: TypeError: unhashable type: 'list'
but my key is not a list, my value is.
What am I doing wrong?
Upvotes: 0
Views: 498
Reputation: 1189
maybe you were looking for this syntax
equipment_element = {'equipment_name': [0,0,0,0,0,0,0]}
or
equipment_element = dict('equipment_name' = [0,0,0,0,0,0,0])
or
equipment_element = dict([('equipment_name', [0,0,0,0,0,0,0])])
This syntax is for creating a set:
equipment_element = {'equipment_name', [0,0,0,0,0,0,0]}
Upvotes: 0
Reputation: 12015
You are trying to create set, not a dictionary
Modify it as follows. Replace the ,
in between to :
equipment_element = {'equipment_name': [0,0,0,0,0,0,0]}
Upvotes: 2