promptdojo_
Checkpoint

One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.

Last drill. Build two dataclasses that fit together:

  1. Address — a frozen=True dataclass with two fields:

    • street: str
    • city: str
  2. Customer — a regular @dataclass with three fields:

    • name: str
    • address: Address (a nested dataclass — required)
    • orders: list defaulting to field(default_factory=list)

Then create two customers sharing the same address (an Address is immutable, so sharing is fine), append an order to each, and print both.

Expected output:

Customer(name='maya', address=Address(street='1 main st', city='oak'), orders=['#1'])
Customer(name='marcus', address=Address(street='1 main st', city='oak'), orders=['#2'])

this step needs the editor

on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.

open this same url on a laptop to keep going today.