In How to hash lists? I was told that I should convert to a tuple first, e.g. [1,2,3,4,5] to (1,2,3,4,5).
So the first cannot be hashed, bu
The answers are good. The reason is the mutability. If we could use list in dicts as keys; (or any mutable object) then we would be able to change the key by mutating that key (either accidentally or intentionally). This would cause change in the hash value of the key in dictionary due to which we would not be able to retrace the value from that data structure by that key. Hash values and Hash tables are used to map the large data with ease by mapping them to indices which stores the real value entries.
Read more about them here:-
Hash Tables & Hash Functions & Assosiative Arrays