CBSE Class 11 Computer Science Question 63 of 112

Dictionaries — Question 3

Back to all questions
3
Question

Question 3

Though tuples are immutable type, yet they cannot always be used as keys in a dictionary. What is the condition to use tuples as a key in a dictionary ?

Answer

The tuple should contain only immutable entries. Only then it can be used as a key in a dictionary.