CBSE Class 11 Computer Science Question 66 of 112

Dictionaries — Question 6

Back to all questions
6
Question

Question 6

In no more than one sentence, explain the following Python error and how it could arise:

TypeError: unhashable type: 'list'
Answer

This type of error occurs when a mutable type like list is used as a key in dictionary — d1 = {[4, 5] : "a"}