🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Python Beginner

What is Dictionary?

A built-in data structure that stores key-value pairs with O(1) average lookup time using hash tables.

Python dictionaries (dict) are mutable, unordered collections of key-value pairs. Keys must be hashable (strings, numbers, tuples). Access values with dict[key] or dict.get(key, default).

Since Python 3.7, dictionaries maintain insertion order. Common methods include .keys(), .values(), .items(), .update(), and .pop(). Dictionary comprehensions provide concise creation syntax.

Related Terms

FastAPI
A modern, high-performance Python web framework for building APIs with automatic OpenAPI documentation and type validation.
Slots
A class mechanism that restricts attribute creation and reduces memory usage by using a fixed set of instance variables.
Decorator
A function that modifies or extends the behavior of another function or class without changing its source code.
Pytest
A testing framework for Python that simplifies writing and running tests with powerful features like fixtures and parametrize.
Pip Requirements File
A text file listing Python package dependencies with version specifications for reproducible project installations.
Python ABC Module
The Abstract Base Classes module that enables defining interfaces and abstract methods that subclasses must implement.
View All Python Terms →