🎁 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

Virtual Environment
An isolated Python environment that maintains its own set of packages, independent of the system Python installation.
Context Manager
An object that manages resources by defining setup and cleanup actions using the with statement.
Comprehension
A concise syntax pattern for creating collections by transforming and filtering items from iterables.
Exception Handling
A mechanism for managing runtime errors using try, except, else, and finally blocks to prevent program crashes.
Python Metaclass
A class whose instances are classes themselves — the class of a class that controls how classes are created and behaved.
Decorator
A function that modifies or extends the behavior of another function or class without changing its source code.
View All Python Terms →