Dictionary Varieties

Learn about the different varieties of dictionaries in Python.

Unique and immutable keys

Keys in a dictionary must be unique and immutable. Numbers, strings, or tuples can be used as keys. If a tuple is used as a key, it should not contain any mutable elements like a list.

Get hands-on with 1200+ tech skills courses.