Six lessons on the class layer. Eight questions, 80% to pass. The questions test design tradeoffs as much as syntax — when a class earns its place, when @dataclass saves you, when type hints actually run.
Let's go.
| Lesson | Concept | Key syntax |
|---|---|---|
| 1 | When a dict isn't enough | dicts-of-dicts hurt at scale |
| 2 | class and __init__ | class Item: def __init__(self, name, value): ... |
| 3 | Methods | def is_high(self): return self.value > 10 |
| 4 | @dataclass | @dataclass class Item: name: str; value: int |
| 5 | Type hints | def add(a: int, b: int) -> int: |
| 6 | When NOT to use a class | functional alternatives — three signals |
If none apply, prefer functions and tuples/dicts.
Create a free account to get started. Paid plans unlock all tracks.
Six lessons on the class layer. Eight questions, 80% to pass. The questions test design tradeoffs as much as syntax — when a class earns its place, when @dataclass saves you, when type hints actually run.
Let's go.
| Lesson | Concept | Key syntax |
|---|---|---|
| 1 | When a dict isn't enough | dicts-of-dicts hurt at scale |
| 2 | class and __init__ | class Item: def __init__(self, name, value): ... |
| 3 | Methods | def is_high(self): return self.value > 10 |
| 4 | @dataclass | @dataclass class Item: name: str; value: int |
| 5 | Type hints | def add(a: int, b: int) -> int: |
| 6 | When NOT to use a class | functional alternatives — three signals |
If none apply, prefer functions and tuples/dicts.