KnowledgeBoat Logo

Computer Science

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

Python Dictionaries

10 Likes

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)

Answered By

6 Likes


Related Questions