Complete for freeIntermediate

Course 5

Object-Oriented Python and Software Design

You will write every line in VS Code with Python 3 and pytest, starting with a bank account that replaces a tangle of parallel lists and growing it into a small library and inventory system. Along the way you model state with classes and methods, choose between composition and inheritance, protect interfaces with properties, express intent with dunder methods, dataclasses, and type hints, raise your own exceptions, split code into modules, and refactor with tests holding the behaviour steady. Every lesson pairs notes with diagrams, step-through traces of objects changing, and code that was really run, then a build-along and a practice set with worked solutions. The course ends with a capstone application you design, test, and explain.

Free completion promise: Python, VS Code, the Python extension, and pytest are all free and open to everyone, so every lesson, exercise, and the capstone can be finished on a home or school computer, including a Chromebook with Linux turned on, for $0.

What's inside

  • 24hand-written lessons
  • 24videos
  • 10step-through animations
  • 31diagrams, charts & live previews
  • 48quiz questions
  • 211code examples

Before you begin

Requirements & setup for Object-Oriented Python and Software Design

Start with the complete free pathway below. Hardware, subscriptions, paid APIs, and cloud credits are never required.

Start here ยท free path

Your complete $0 setup

Python, VS Code, the Python extension, and pytest are all free and open to everyone, so every lesson, exercise, and the capstone can be finished on a home or school computer, including a Chromebook with Linux turned on, for $0.

$0 required

Setup checklist

0 of 7 complete

This checklist is a temporary setup aid and resets when the page reloads. Saved course progress begins in the setup lessons below.

  1. Everything required for this course is free. Paid software, APIs, cloud credits, GPUs, and physical equipment are optional.

    About 2 min
  2. Install Python 3.10 or newer from python.org (on Windows, the Python install manager; on a Chromebook, turn on the Linux development environment and install python3 with apt).

  3. Install VS Code from code.visualstudio.com, then install the Python extension by Microsoft from the Extensions view.

    About 5 min
  4. Make a project folder, open it in VS Code, and create a virtual environment with python -m venv .venv (python3 on macOS, Linux, and Chromebooks).

    About 5 min
  5. Select the .venv interpreter, open a new terminal, and run python -m pip install pytest.

    About 5 min
  6. Save a file named test_first.py with one test function and run python -m pytest.

    About 5 min
  7. VS Code with Python 3 and pytest: The terminal prints a green line ending in "passed", and the beaker icon's Testing view lists your test with a green check.

    About 5 min

Software

1 item

VS Code with Python 3 and pytest

Visual Studio Code is a free editor; with Microsoft's Python extension it runs, debugs, and tests Python files. pytest is the free testing tool the course uses to check every class you write.

Course need
VS Code with Python 3 and pytest
Free

Visual Studio Code is a free editor; with Microsoft's Python extension it runs, debugs, and tests Python files. pytest is the free testing tool the course uses to check every class you write. Every lesson is readable text with copyable code, keyboard-friendly quizzes and step-throughs, and videos with YouTube captions.

  1. Install Python 3.10 or newer from python.org (on Windows, the Python install manager; on a Chromebook, turn on the Linux development environment and install python3 with apt).
  2. Install VS Code from code.visualstudio.com, then install the Python extension by Microsoft from the Extensions view.
  3. Make a project folder, open it in VS Code, and create a virtual environment with python -m venv .venv (python3 on macOS, Linux, and Chromebooks).
  4. Select the .venv interpreter, open a new terminal, and run python -m pip install pytest.
  5. Save a file named test_first.py with one test function and run python -m pytest.

Hardware

Nothing required

No physical hardware is needed for this course.

Accounts

Nothing required

No external account is needed for this course.

What you will be able to do

Learning outcomes

  • Model a problem with classes whose methods keep each object's state valid.
  • Decide between composition and inheritance for a relationship and explain the trade-off.
  • Protect an interface with properties, dunder methods, dataclasses, and type hints.
  • Signal failures with custom exceptions and organize code into importable modules.
  • Write pytest tests and use them to refactor a multi-module program safely.
  • Design, build, and present a tested object-oriented application with a class diagram.

Build real work

Assignments & capstone

Free tools accepted

Classes for a small system

Write Python classes for a small system, such as library loans or a delivery fleet, whose objects validate every change through methods, with at least one has-a relationship, one subclass, and pytest tests for the main rules.

Python, VS Code, the Python extension, and pytest are all free and open to everyone, so every lesson, exercise, and the capstone can be finished on a home or school computer, including a Chromebook with Linux turned on, for $0. Submit your project file, or screenshots with descriptions, or a short demo.

Tested inventory behind a clean interface

Build a school-shop inventory in Python with properties that guard its values, frozen dataclasses for records, and an abstract storage interface with two backends, writing pytest tests first, including one that uses a fake.

Python, VS Code, the Python extension, and pytest are all free and open to everyone, so every lesson, exercise, and the capstone can be finished on a home or school computer, including a Chromebook with Linux turned on, for $0. Submit your project file, or screenshots with descriptions, or a short demo.

Final assessment

Object-oriented command-line app

Design and build a command-line Python app, such as library loans, a text adventure engine, or a turn-based arena, with five or more focused classes, composition, an interface with two implementations, custom exceptions, and a package that runs with python -m. Deliverables: Python package with 3+ modules, 12+ passing pytest tests, including error paths and a fake, DESIGN.md with a class diagram and justified relationships, One documented refactor, and Five-minute demo.

Prerequisites & pacing

Skills assumed

  • Write and call Python functions with parameters and return values
  • Use lists, dicts, loops, and if statements comfortably
  • Read a basic error message and find the line it points to

Recommended prior courses

These are advisory, not locks. If you already have the skills listed above, enroll directly.

Choose your pace

  • self paced: 10 weeks at 5 hours per week
  • weekly: 10 weeks at 5 hours per week

Part of this learning path

Course created by Zafir Shamsi.