Brainlag
  1. Python
  2. Errors and files
24/42 lessons

JSON: data that programs share

25 min5 exercisesPremium

Read and write JSON in Python: json.loads and json.dumps, json.load and json.dump with files, and nested dicts and lists from a real game library.

The skill
Load, change and save JSON data, nested lists and dicts included.
You make
Tools for a game library file and a settings loader with defaults.

Premium lesson

£7.99 a month or £59 a year. Cancel any time.

Builds on 23 Reading and writing files. Free to try: Python Foundations and the playground.

Step 1 of 8
exercise_1.py

You've reached the good stuff.

5 exercises in this lesson, checked as you type. Premium opens every lesson after Foundations, in all four courses.

Python 3.13