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.
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.
- 1.1Why Python?Say what Python is and why it is used for AI and machine learning, and know where Python code is written and run.Open
- 1.2Run Your First Python CodeRun Python in a notebook and know what happens when a cell executes.Open
- 1.3Variables, Keywords and IdentifiersBind names to objects, and name variables by Python's rules.Open
- 1.4Data TypesKnow the basic types and how they convert.Open
- 1.5Input, Output and FormattingRead input and print results readably.Open
- 1.6OperatorsCompute and compare with Python's operators, and know their precedence.Open
Control Flow
5 lessons, in production
- 2.1if, elif and elseMake the program choose.In production
What it will cover
- Conditions, branches, nesting
- Indentation defines a block;
IndentationError - Truthiness
matchfor choosing among several literal cases (Python 3.10+)
- 2.2while LoopsRepeat until a condition changes, and avoid infinite loops.In production
What it will cover
- The loop, animated with its condition
- Counters and sentinels
- The assignment expression
:=in a loop condition
- 2.3for Loops and rangeIterate over any sequence.In production
What it will cover
forover lists and strings;rangeenumerateandzip
- 2.4break, continue and else on LoopsControl a loop from the inside.In production
What it will cover
breakandcontinue, animated- The loop
elseclause
- 2.5ComprehensionsBuild lists, sets and dicts in one readable line.In production
What it will cover
- List comprehensions, with a condition
- Dict and set comprehensions
- When a plain loop is clearer
Data Structures
5 lessons, in production
- 3.1ListsStore ordered, changeable collections and slice them.In production
What it will cover
- Indexing, slicing, negative indices
- Append, insert, remove, sort
- Mutability, and aliasing (two names, one list)
- 3.2TuplesUse fixed-size immutable records, and unpack them.In production
What it will cover
- Immutability
- Packing and unpacking; returning several values
- 3.3SetsKeep unique items and ask membership questions fast.In production
What it will cover
- Uniqueness
- Union, intersection, difference
- Fast membership
- 3.4DictionariesMap keys to values: counting, grouping, lookup.In production
What it will cover
- Keys, values, items
- Counting with a dict;
defaultdictandCounter - Nested dictionaries
- 3.5StringsClean and split text, the first step of every text model.In production
What it will cover
- Indexing and slicing strings
split,join,strip,lower,replace- A first tokeniser
Functions
4 lessons, in production
- 4.1Defining FunctionsPackage code into reusable functions with inputs and outputs.In production
What it will cover
def, parameters,return- Type hints on parameters and return values
- Docstrings
- Built-in against user-defined functions
- 4.2Arguments and ScopePass arguments every way Python allows, and know where names live.In production
What it will cover
- Positional, keyword, default arguments
*argsand**kwargs- Local and global scope; the mutable-default trap
- 4.3RecursionSolve a problem by calling the same function on a smaller version of it.In production
What it will cover
- The base case and the recursive case
- The call stack, animated
- Recursion against a loop
- 4.4Lambdas and Functions as ValuesPass functions around, the pattern behind `sorted(key=...)` and `apply`.In production
What it will cover
- Lambda functions
map,filter,sortedwithkey- Functions as arguments
Organising Code
9 lessons, in production
- 5.1Modules and PackagesSplit code across files and import it; use other people's packages.In production
What it will cover
import,from ... import, aliases- Your own module; packages and
__init__.py
- 5.2uv, Packages and EnvironmentsInstall Python and packages for a project without breaking other projects.In production
What it will cover
- Installing Python and creating a project with
uv uv add,pyproject.tomland the lockfile- Virtual environments: what
uvcreates, and whatvenvandpipdo underneath - Running Jupyter locally, and in VS Code
- Installing Python and creating a project with
- 5.3Working with FilesRead and write text, CSV and JSON files.In production
What it will cover
- Opening files;
with; text encoding (UTF-8) - CSV and JSON
- Paths with
pathlib
- Opening files;
- 5.4ExceptionsHandle errors deliberately instead of crashing.In production
What it will cover
- Reading a traceback
try,except,finally; raising your own
- 5.5DebuggingFind a bug systematically.In production
What it will cover
- Print debugging, and its limits
- The debugger: breakpoints, stepping, inspecting
- Reproducing a bug with the smallest input
- 5.6Testing with assert and pytestCheck that code does what it should, automatically and every time it changes.In production
What it will cover
assertfor a single check- Writing test functions and running
pytest - What to test: normal cases, edge cases, the error cases
- 5.7Formatting, Linting and Type CheckingLet tools find the mistakes a reader would otherwise have to find.In production
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
- 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.In production
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
- 5.9Version Control with Git (optional)Record every change to a project, and go back to any earlier version.In production
What it will cover
- Commits, the history, and
diff - Branches, briefly
- GitHub: pushing a project and sharing a notebook
- Commits, the history, and
Objects and Classes
3 lessons, in production
- 6.1Classes and ObjectsBundle data and behaviour into objects, and read code that does.In production
What it will cover
class,__init__,self- Attributes and methods
- Inheritance, briefly
- 6.3DataclassesDefine a class that mainly holds data in a few lines, with type hints.In production
What it will cover
@dataclass, fields and type hints- Generated
__init__,__repr__and__eq__ - Defaults and frozen dataclasses
- 6.2The Estimator PatternWrite a tiny model class with `fit` and `predict`, the shape every scikit-learn model has.In production
What it will cover
- State learned in
fit, stored with a trailing underscore predictusing that state- A from-scratch mean predictor, then k-NN, in that shape
- State learned in
Thinking About Cost
3 lessons, in production
- 7.1Time and Space ComplexityEstimate how running time grows with input size.In production
What it will cover
- Counting operations; Big-O
- The largest number in a list: O(n)
- Space complexity
- 7.2Binary SearchFind an item in a sorted list in log time.In production
What it will cover
- Halving, animated
- O(log n) against O(n)
- 7.3Hash TablesSee why a dict lookup is fast, and use that to speed up an algorithm.In production
What it will cover
- Common elements of two lists: O(n·m) → O(n + m)
- Hashing, buckets and collisions, pictured
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.