Why can a tuple be used as a dictionary key but a list cannot?
- A Tuples are shorter
- B Tuples are immutable and therefore hashable
- C Lists are too slow
- D Dictionaries only accept sequences
Answer
Tuples are immutable and therefore hashable
Dictionary keys must be hashable, which requires immutability so the hash cannot change while the object is stored.





