CBSE Class 11 Computer Science Question 6 of 112

Dictionaries — Question 6

Back to all questions
6
Question

Question 6

Which of the following types qualify to be the keys of a dictionary?

  1. String
  2. tuple
  3. Integer
  4. float
  5. list
  6. dictionary
Answer

The following types can be used as keys of a dictionary because they are immutable:

  1. String
  2. tuple
  3. Integer
  4. float

As lists and dictionaries are mutable so they cannot be used as keys of a dictionary.