Code Lab BetaBUILD. RUN. DISCOVER.
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Loading…
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Loading…
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
PYTHON FILES / CHAPTER 05 / Learn / LESSON 09
Before a JSON file — data in memory:
rows = [ {"sku": "A1", "qty": 2}, {"sku": "B2", "qty": 1}, ] summary = {"count": len(rows), "first": rows[0]["sku"]} print(summary["first"]) print(summary["count"])
A list of dicts is a typical row shape. Nested keys and lists will serialize with json.
Learn: prep for JSON.
PROFILE IDLE
›