15
Question Question 11(b)
my_dict = {}
my_dict[(1,2,4)] = 8
my_dict[[4,2,1]] = 10
print(my_dict)Output
TypeError: unhashable type: 'list'
Explanation
The line my_dict[[4,2,1]] = 10 is in error because a list is being used as a key of the dictionary. Lists being mutable data types are not allowed as keys in a dictionary.