Open workspace
Track 1 of 5 · Beginner

Pythonfrom your first line to real ML code.

Every lesson shows what the interpreter actually does, line by line, so you can predict what code will do before you run it.

7modules
35lessons planned
6ready to study now
30quiz questions so far

The syllabus7 modules, one objective per lesson.

The course is being built in this order. Every lesson is listed, including the ones still in production, so you can see where the track goes. Open lessons have their parts, key terms and quiz free.

Module 2

Control Flow

5 lessons, in production

  1. 2.1if, elif and elseMake the program choose.
    What it will cover
    • Conditions, branches, nesting
    • Indentation defines a block; IndentationError
    • Truthiness
    • match for choosing among several literal cases (Python 3.10+)
    In production
  2. 2.2while LoopsRepeat until a condition changes, and avoid infinite loops.
    What it will cover
    • The loop, animated with its condition
    • Counters and sentinels
    • The assignment expression := in a loop condition
    In production
  3. 2.3for Loops and rangeIterate over any sequence.
    What it will cover
    • for over lists and strings; range
    • enumerate and zip
    In production
  4. 2.4break, continue and else on LoopsControl a loop from the inside.
    What it will cover
    • break and continue, animated
    • The loop else clause
    In production
  5. 2.5ComprehensionsBuild lists, sets and dicts in one readable line.
    What it will cover
    • List comprehensions, with a condition
    • Dict and set comprehensions
    • When a plain loop is clearer
    In production
Module 3

Data Structures

5 lessons, in production

  1. 3.1ListsStore ordered, changeable collections and slice them.
    What it will cover
    • Indexing, slicing, negative indices
    • Append, insert, remove, sort
    • Mutability, and aliasing (two names, one list)
    In production
  2. 3.2TuplesUse fixed-size immutable records, and unpack them.
    What it will cover
    • Immutability
    • Packing and unpacking; returning several values
    In production
  3. 3.3SetsKeep unique items and ask membership questions fast.
    What it will cover
    • Uniqueness
    • Union, intersection, difference
    • Fast membership
    In production
  4. 3.4DictionariesMap keys to values: counting, grouping, lookup.
    What it will cover
    • Keys, values, items
    • Counting with a dict; defaultdict and Counter
    • Nested dictionaries
    In production
  5. 3.5StringsClean and split text, the first step of every text model.
    What it will cover
    • Indexing and slicing strings
    • split, join, strip, lower, replace
    • A first tokeniser
    In production
Module 4

Functions

4 lessons, in production

  1. 4.1Defining FunctionsPackage code into reusable functions with inputs and outputs.
    What it will cover
    • def, parameters, return
    • Type hints on parameters and return values
    • Docstrings
    • Built-in against user-defined functions
    In production
  2. 4.2Arguments and ScopePass arguments every way Python allows, and know where names live.
    What it will cover
    • Positional, keyword, default arguments
    • *args and **kwargs
    • Local and global scope; the mutable-default trap
    In production
  3. 4.3RecursionSolve a problem by calling the same function on a smaller version of it.
    What it will cover
    • The base case and the recursive case
    • The call stack, animated
    • Recursion against a loop
    In production
  4. 4.4Lambdas and Functions as ValuesPass functions around, the pattern behind `sorted(key=...)` and `apply`.
    What it will cover
    • Lambda functions
    • map, filter, sorted with key
    • Functions as arguments
    In production
Module 5

Organising Code

9 lessons, in production

  1. 5.1Modules and PackagesSplit code across files and import it; use other people's packages.
    What it will cover
    • import, from ... import, aliases
    • Your own module; packages and __init__.py
    In production
  2. 5.2uv, Packages and EnvironmentsInstall Python and packages for a project without breaking other projects.
    What it will cover
    • Installing Python and creating a project with uv
    • uv add, pyproject.toml and the lockfile
    • Virtual environments: what uv creates, and what venv and pip do underneath
    • Running Jupyter locally, and in VS Code
    In production
  3. 5.3Working with FilesRead and write text, CSV and JSON files.
    What it will cover
    • Opening files; with; text encoding (UTF-8)
    • CSV and JSON
    • Paths with pathlib
    In production
  4. 5.4ExceptionsHandle errors deliberately instead of crashing.
    What it will cover
    • Reading a traceback
    • try, except, finally; raising your own
    In production
  5. 5.5DebuggingFind a bug systematically.
    What it will cover
    • Print debugging, and its limits
    • The debugger: breakpoints, stepping, inspecting
    • Reproducing a bug with the smallest input
    In production
  6. 5.6Testing with assert and pytestCheck that code does what it should, automatically and every time it changes.
    What it will cover
    • assert for a single check
    • Writing test functions and running pytest
    • What to test: normal cases, edge cases, the error cases
    In production
  7. 5.7Formatting, Linting and Type CheckingLet tools find the mistakes a reader would otherwise have to find.
    What it will cover
    • Formatting and linting with Ruff
    • Running a type checker on annotated code
    • Reading a tool's report, and fixing what it finds
    In production
  8. 5.8Working with an AI Coding AssistantUse an AI assistant to write and explain code, and verify every line it produces before relying on it.
    What it will cover
    • Asking for code, for an explanation, and for a fix
    • Verifying: predict what the code does, run it, test it
    • The mistakes assistants make: invented functions, outdated APIs, code that runs but is wrong
    • What stays the learner's job: understanding every line that ships
    In production
  9. 5.9Version Control with Git (optional)Record every change to a project, and go back to any earlier version.
    What it will cover
    • Commits, the history, and diff
    • Branches, briefly
    • GitHub: pushing a project and sharing a notebook
    In production
Module 6

Objects and Classes

3 lessons, in production

  1. 6.1Classes and ObjectsBundle data and behaviour into objects, and read code that does.
    What it will cover
    • class, __init__, self
    • Attributes and methods
    • Inheritance, briefly
    In production
  2. 6.3DataclassesDefine a class that mainly holds data in a few lines, with type hints.
    What it will cover
    • @dataclass, fields and type hints
    • Generated __init__, __repr__ and __eq__
    • Defaults and frozen dataclasses
    In production
  3. 6.2The Estimator PatternWrite a tiny model class with `fit` and `predict`, the shape every scikit-learn model has.
    What it will cover
    • State learned in fit, stored with a trailing underscore
    • predict using that state
    • A from-scratch mean predictor, then k-NN, in that shape
    In production
Module 7

Thinking About Cost

3 lessons, in production

  1. 7.1Time and Space ComplexityEstimate how running time grows with input size.
    What it will cover
    • Counting operations; Big-O
    • The largest number in a list: O(n)
    • Space complexity
    In production
  2. 7.2Binary SearchFind an item in a sorted list in log time.
    What it will cover
    • Halving, animated
    • O(log n) against O(n)
    In production
  3. 7.3Hash TablesSee why a dict lookup is fast, and use that to speed up an algorithm.
    What it will cover
    • Common elements of two lists: O(n·m) → O(n + m)
    • Hashing, buckets and collisions, pictured
    In production

What you’ll learnby the end of the track.

  • Predict what a piece of Python code does before running it.
  • Read an error message and find the line that caused it.
  • Write functions, classes and tests for real data tasks.
  • Read and check code an AI assistant wrote for you.

Before you startand how the lessons work.

  • None. This is the starting point if you have never programmed. Everything runs in Google Colab, in the browser.
  • Every open lesson shows its parts, key terms and quiz for free. Sign in to check your answers and save your progress.
  • While the course is being recorded, the practice problems, common mistakes, self-checking notebooks, cheat sheets and project checks are free with an account too.

Where it leadslive roles this track prepares you for.

Openings from companies’ own career pages, updated continuously.

Questionsabout this track.

Do I need to install anything?

No. Every lesson runs in Google Colab in the browser. Installing Python locally is taught later in the track, when a project needs it.

Which version of Python does the course use?

Python 3.12, the version Google Colab runs. Every output shown in a lesson was recorded on it.

I already know some Python. Where should I start?

Skip ahead if you can already write a function that loops over a list. The Data Tools track is the next step.

The other tracksand the order to take them in.

See the learning path