Key-value pairs for efficient data lookup
Dictionaries are unordered collections of key-value pairs that provide efficient data retrieval by key. They are created with curly braces {} or the dict() constructor. Keys must be immutable types (strings, numbers, tuples) and unique within a dictionary. Values can be any type and can be duplicated. Dictionaries support efficient lookup, insertion, and deletion operations (average O(1) time complexity). Common operations include accessing values by key (dict[key]), adding or updating items (dict[key] = value), checking key existence (key in dict), and iterating over keys, values, or items. Dictionary methods include get() (safe key access with default), keys(), values(), items(), pop(), update(), and more. Dictionaries are fundamental for representing structured data, configuration settings, mappings, and any situation where efficient lookup by key is needed. They are one of Python's most powerful and frequently used data structures.