Python Quest

Track 8 · Lesson 7 of 11

Working with JSON

Read and write JSON with json.load, json.loads, json.dump and json.dumps, map JSON types to Python, and navigate nested data.

About 45 minIntermediate5 exercises

You will be able to

  • Convert between JSON text and Python values with json.loads() and json.dumps()
  • Read and write JSON files with json.load() and json.dump(), using indent for readable output
  • Describe how JSON objects, arrays, strings, numbers, true/false and null map to Python types, and what changes on the way
  • Navigate nested JSON with chained indexing and .get() for optional fields

Included with a Formula Quest membership

It has 5 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.

View Formula Quest memberships

Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.