Skip to content

3.3.1 Key–Value Structure

A dictionary stores data as pairs of keys and values.
Each key is used to access its corresponding value.


Dictionary Characteristics

  • Keys must be unique
  • Keys are immutable data types
  • Values can be of any data type
  • The dictionary grows dynamically

Common Use Cases

  • Storing configuration settings
  • Representing objects or records
  • Mapping identifiers to values

📌 Note:
Attempting to access a non-existent key results in an error.