Question: why are dictionary keys immutable?
Answer: Why must dictionary keys be immutable? The hash table implementation of dictionaries uses a hash value calculated from the key value to find the key. If the key were a mutable object, its value could change, and thus its hash could also change. ... Tuples are immutable and can therefore be used as dictionary keys.