When data carries labels instead of positions, dictionaries map keys to values for fast, readable lookups. You will create and query them, add and update entries, iterate over keys and values, and nest lists and dictionaries to model the structured records real applications depend on.
Overview
Syllabus
Organizing Data with Dictionaries
- Build a User Profile Dictionary
- Read a Missing Profile Key
- Add a Fallback Email Lookup
- Check Whether a Key Exists
Modifying Python Dictionaries
- Add Stock to the Product Record
- Drop the Notebook Price
- Batch the Product Record Edits
- Trim the Product Record
Iterating Through Dictionaries
- Print Every Inventory Item Name
- Total the Inventory Units
- Print the Inventory Report Lines
- Flag the Out of Stock Items
Organizing Nested Data
- Print Nested User Details
- Add Quinn to the Editor List
- Count Roles Across User Records
- Build a List of Project Records