Python
Learn Python end to end. Syntax, data structures, OOP, generators, async, testing, and packaging.
19 lessons, in order
- 120 min
Hello, Python
Welcome. If you have never written code before, you are in the right place. Python is a programming language, which is a way to give a computer...
VariablesPrintRepl - 225 min
Numbers and Strings
Welcome back. In lesson 01 you ran your first Python file and learned that a variable is a labelled box that holds a value. Today we look at the two...
IntegersFloatsString concatenationF-strings - 315 min
Asking the User a Question
So far you have written programs that always do the same thing when you click play. Run them ten times, get the same ten answers. They are useful,...
Input()String return typeInt() and float() conversionInteractive programs - 430 min
Control Flow
Up to now your programs have run straight through, top to bottom, one line after the other. That is fine for greetings, but most useful programs need...
If/elif/elseComparison operatorsBoolean operatorsWhile loopsFor loopsBreak and continue - 530 min
Lists and Tuples
So far each variable has held a single value: one number, one string. Real programs usually need to keep a small group of related values together,...
List creationIndexingSlicingAppendPopIteration+2 - 630 min
Dictionaries and Sets
Welcome back. Lists are great when order matters and you reach for items by position, but a lot of real data is organized by name: a person has an...
Dict basicsGet with defaultIterate keysIterate valuesIterate itemsSets+1 - 730 min
Functions
Welcome back. So far you have used a few functions that came with Python, like print() and len(). In this lesson you are going to write your own. A...
DefParametersDefault valuesKeyword arguments*args and **kwargsReturn values+1 - 825 min
Comprehensions
You already know how to write a for loop that builds a new list, dict, or set one item at a time. A comprehension is a shorter way to write that same...
List comprehensionsDict comprehensionsSet comprehensionsConditional expressionsGenerator expressionsReadability tradeoffs - 930 min
Files and IO
A program that only prints to the terminal forgets everything the moment it finishes. The next step, and the one that makes Python suddenly feel...
Open with withReading linesWriting filesPathlib.PathJson readJson write - 1030 min
Modules and Packages
Up to now every program has lived in a single file. That is fine while you are learning, but real projects spread their code across many files so...
ImportFrom importWriting your own moduleIf __name__ == "__main__"Packages__init__.py - 1135 min
Classes and OOP
Welcome to one of the bigger ideas in Python. So far you have used built-in tools (strings, lists, dicts, functions) to shape data. In this lesson...
Class definition__init__Instance attributesClass attributesMethods__repr__ - 1230 min
Inheritance and Composition
In lesson 11 you built classes from scratch. In real code, classes rarely live alone. Sometimes one class is a more specific version of another (a...
SubclassingSuper()Method overridingCompositionWhen to choose composition - 1330 min
Exception Handling
You have already met errors. Every time you mistyped a name, divided by zero, or asked a list for an index that did not exist, Python stopped and...
TryExceptElseFinallyRaiseCustom exception classes+1 - 1430 min
Iterators and Generators
You already know how to write for item in something: from earlier lessons. In this lesson we look under the hood and find out what Python is actually...
Iterator protocolYieldGenerator functionsGenerator expressionsLazy evaluation - 1530 min
Decorators
Welcome to one of Python's trickier topics. A decorator is a small wrapper you put around a function so it gains a little extra behaviour (logging,...
Functions are objectsWrapper functions@decorator syntaxFunctools.wrapsParametrized decorators - 1625 min
Context Managers
Welcome back. Ever since lesson 09 you have been writing with open(...) as f: and trusting that the file gets closed when the block ends. This lesson...
With statement__enter__ and __exit__Writing your own context managerContextlib.contextmanager - 1740 min
Concurrency: Threads and Async
Welcome back. So far our programs have done one thing at a time, top to bottom, and that has worked fine. The trouble starts when a program spends...
GIL in plain languageConcurrent.futures.ThreadPoolExecutorAsyncio basicsAsync defAwaitWhen to use threads vs async - 1835 min
Testing with pytest
Welcome back. Up to now you have run code and checked the output with your eyes. That works for a few lines, but the moment you change anything, you...
Test functionsAssertRunning pytestParametrizeFixtures - 1935 min
Packaging and Deployment
So far you have written Python that you (and only you) run by typing python something.py. This lesson is about the small, mostly-mechanical step that...
Pyproject.tomlPip install -eConsole scriptsBuilding a wheelPublishing to PyPI
Learn Python in your language
Every lesson, quiz, and tutor reply renders in your language. The AI tutor matches the language you ask in.
Roles that use Python
See how hiring teams interview engineers on Python, in production-like environments.
Senior Python Developer
Hire senior Python developers in real Django, FastAPI and Flask codebases with real load and real test suites. Live or take-home, fully recorded.
See the interviewBackend Engineer (Go, Rust, Java)
Hire backend engineers in real services with real databases, real concurrency and real latency budgets. Live or take-home, fully recorded.
See the interviewData Engineer
Hire data engineers in workspaces with real Spark, dbt and Airflow pipelines. Schema drift, bad data and reruns included.
See the interview