KnowledgeBoat Logo

Computer Science

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

Python Dictionaries

CBSE

1 Like

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.

Answered By

1 Like


Related Questions