Beginner·7 min·basics · data structures
Nested Data
Nested Data
Real data is almost always nested: lists of records, dicts of dicts.
Access
data[0]["field"]— chain subscripts left to right- Always think about what type each step returns
Useful pattern: dict.setdefault
d.setdefault(key, []).append(x) — start an empty list under key if missing, then append. The bread-and-butter of grouping.
Try it
- Build a list of skills sorted by how many users have them.
- Find users who know
"git".