Computer Science

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

Python Dictionaries

16 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

9 Likes


Related Questions