Phase 0 · Tools · Python core
Dictionaries
Look values up by name: the shape of almost all real-world data.
Why it matters
Real data is made of records with named fields: a campaign has a name, a budget and a status; a lead has an email and a source. Dictionaries are how Python holds a record. They matter even more for AI work, because APIs send and receive data as nested dictionaries and lists, and every message you send to an LLM is a small dictionary: {"role": "user", "content": "..."}.
What you'll be able to do
- Store a record as key-value pairs and look values up by key
- Add, change and remove entries, and handle missing keys with .get()
- List a dictionary's keys, values and items
- Read and build nested data: lists of dictionaries, like an LLM chat request
Before this lesson
Next in this phase: Functions