How should a Python program organize information that changes? This course starts with a function and a dictionary, then introduces classes, supported state changes, collaboration, and the choice between composition and inheritance. Examples are small enough to trace, with explicit limits where a design offers no security or transaction guarantee.
Before starting
Be comfortable with Python variables, functions, lists, dictionaries, loops, conditionals, and raising and catching exceptions. No previous class-design experience is assumed. Examples use Python 3 and each Python block runs independently. Read the chapters in order; diagrams are explanatory, not program output.
Chapters
- Finding a home for state — functions, objects, references, and attributes.
- Keeping state consistent — invariants, methods, boundaries, and collaboration.
- Designing collaboration — interfaces, contracts, delegation, and polymorphism.
- Choosing relationships — inheritance, substitution, composition, and Python operations.
Finish with the 20-question assessment. It checks conceptual understanding, not independent programming ability.