KnowledgeBoat Logo

Computer Science

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

TypeError: unhashable type: 'list'

Python Dictionaries

9 Likes

Answer

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

Answered By

4 Likes


Related Questions