📝 Edit page
➕ Add page
Dictionary
Mutable of object of key-value pairs.
Keys must be immutable so they can be hashed. e.g. str
, int
, tuple
. Not a list
or dict
.
Related
- dict in the Python docs.
- dictionary type checks for how to annotate your dict and validate usage with type checking.
Create
{"a": 1, "b": 2}
dict(a=1, b=2)