dict
{'a': 95, 'b': 96, 'c': 97}
>>> dict[(1,2,3)]=98
>>> dict
{'a': 95, 'b': 96, 'c': 97, (1, 2, 3): 98}
>>> dict[(1,[2,3])]=99
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'
Sign in to make a reply
可爱本可biu
dict
{'a': 95, 'b': 96, 'c': 97}
>>> dict[(1,2,3)]=98
>>> dict
{'a': 95, 'b': 96, 'c': 97, (1, 2, 3): 98}
>>> dict[(1,[2,3])]=99
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'