Part 3 · Section 06

Project 1

APIs, configuration files and message queues all hand you nested dictionaries, usually decoded from JSON, and before you use one you want to know it has the shape you expect. In this project you’ll write a small validator that checks a nested dictionary against a template: the same keys at every level, and values of the right types.

The code is short, but it brings together several ideas from this part: set operations on dictionary keys views, recursion over nested dictionaries, deterministic error messages from unordered sets, and custom exceptions.

In this project you’ll practice:

Lectures

  1. 01Project 1✓
  2. 02Project 1 - Solution✓

Practice: quiz & exercises

7 quiz questions · 3 coding exercises

Go to practice →