-
Dictionary in Python
A dictionary is a collection of key-value pairs where each key is unique, and values can be
of any data type. Dictionaries are mutable and are defined using {} (curly braces).
1. Concept of Key-Value Pairs
A key acts as an identifier (e.g., a name, ID).
A value is the associated data.
Keys must be immutable (strings, numbers, or tuples), while values can be any data type.
2. Creating and Initializing a Dictionary:
3. Traversing a Dictionary:
4. Updating a Dictionary:
5. Deleting Elements from a Dictionary:
SUMMARY-1
SUMMARY-2: