
Tempo Catalog Warmup
Count tracks, total runtime, genre mix, and top performer in a music catalog using pure Python loops.
You're an analyst at Tempo, a music streaming startup. The label pitch is Friday, and the team needs the prototype catalog sanity-checked before it ships.
The catalog is already in your notebook as a list of Python dicts — no pandas yet. Five short steps, ~30 minutes. The last step wraps the logic in a reusable function.
What you'll practice: lists, dicts, for-loops, conditionals, function design.
You'll practice
Python ProgrammingLists and DictionariesLoops and ConditionalsFunctions
Loading kernel…
1
Meet the catalog
40 XPThe prototype catalog is already in your notebook as a list of dicts called songs. Get oriented: how many songs are in it? Use len() and assign the result to num_songs.
Done when: num_songs holds the catalog's length.
| title | artist | genre | duration_sec | plays |
|---|---|---|---|---|
| Midnight Drive | Luna Park | pop | 215 | 124000 |
| Coastline | The Reverbs | indie | 198 | 45000 |
| Engine Room | Catalyst | rock | 232 | 156000 |
| Ferns | Quiet Animals | indie | 187 | 32000 |
| Borrowed Time | Luna Park | pop | 244 | 210000 |
| Wild Pulse | Catalyst | rock | 201 | 98000 |
| Halogen | Modular | electronic | 219 | 132000 |
| Stay Up Late | June Hills | pop | 176 | 89000 |
| Slow Rotation | Quiet Animals | indie | 263 | 78000 |
| Hometown | June Hills | pop | 209 | 45000 |