promptdojo_

The shapes AI dumps on you — lists, dicts, and nesting — step 7 of 8

AI tried to read roles[\"admin\"] from a list and crashed with TypeError: list indices must be integers. The roles field is a list of strings, not a dict. Fix line 9 so the script prints admin (the first role).

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

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