promptdojo_

Comprehensions and the wrong-layer bug — step 5 of 8

Cursor wrote a one-liner to list every team name in the org — and looped the wrong layer. for team in org walks the keys of the outer dict ("name", "teams"), not the list of teams, so each team is a string and team["name"] crashes with TypeError: string indices must be integers.

Fix line 9 so the script prints ['eng', 'ops'].

The break is on line 9 — but read the whole snippet first.

full-screen editor opens — close anytime to keep reading.