The Shape of Real Data

Everything you've learned converges here. Real data, from an API, a spreadsheet, a database, a survey, almost always arrives in one shape: a list of records, where each record has labeled fields.

Once you can read that shape and reach into it, you can work with any dataset in the world.

EXAMPLE
loading editor…
YOUR TURN
Your turn → Print the year of the last book using its index. Then print the author of the first.
loading editor…

Syntax has to be exact. Every quote, bracket and parenthesis needs its partner, and in Python the spaces at the start of a line count. One slip and the program won't run; the message will say where.

✦ Read data structures inside-out

books[2]["title"] looks dense until you read it in steps: books is the list → [2] picks the third record → ["title"] pulls one field out of it. Every nested structure unwraps the same way, one layer at a time.

Mark this lesson complete

Signed in, your progress follows you to every device.

Next: Asking Questions of Data →
← Back