CBSE Class 11 Computer Science Question 62 of 112

Dictionaries — Question 2

Back to all questions
2
Question

Question 2

What type of objects can be used as keys in dictionaries ?

Answer

Keys of a dictionary must be of immutable types such as

  1. a Python string
  2. a number
  3. a tuple (containing only immutable entries)