Learn Python
Understand the language, practise independently, then connect the parts in working programs.
Choose your starting point
91 lessons · 41 syntax entries · 14 additional practice and interview tasks. Existing lesson exercises remain available throughout the course.
The complete course
91 lessons in 17 sections
Fundamentals
14 lessonsPython fundamentals are the basic rules for writing instructions, representing values and controlling what a program does.
- Basic Syntax & Output16 min
- Variables & Data Types17 min
- Operators & Math18 min
- Working with Strings18 min
- Conditionals21 min
- Loops20 min
- Type Casting & Input20 min
- Functions27 min
- Exceptions & Errors20 min
- Built-in Functions20 min
- Lists, Tuples & Sets22 min
- Dictionaries22 min
- Type Annotations20 min
- Capstone — Bill Splitter & Tip Calculator40 min
Fundamentals Follow-up Projects
4 lessonsA programming project combines several small concepts into a tool that solves one complete problem.
Objects
7 lessonsObject-oriented programming organizes a program around objects: values that combine their own state with operations on that state.
- What Is OOP?18 min
- Classes & Instances19 min
- Encapsulation20 min
- Inheritance20 min
- Polymorphism19 min
- Abstraction20 min
- Dunder Methods19 min
The Object Model
4 lessonsPython’s object model describes how values behave as objects and how names refer to them.
Iteration & Laziness
4 lessonsIteration means taking values from a source one at a time. Laziness means postponing work until its result is requested.
Functional Python
5 lessonsFunctional programming emphasizes composing functions and transforming values. Scope determines which binding a name refers to.
Closures & Decorators
6 lessonsA closure is a function that retains access to names from an enclosing function. A decorator transforms or wraps a callable to add behavior.
- Closures & the Cell25 min
- Decorators27 min
- Decorators That Take Arguments27 min
- functools27 min
- Callables, *args & Signatures25 min
- Capstone — The Middleware Ring43 min
The Standard Toolbox
5 lessonsPython’s standard library is the collection of modules supplied with Python for common programming tasks.
- Collections: Counter, defaultdict, namedtuple, OrderedDict19 min
- deque and heapq19 min
- Enum17 min
- math and random18 min
- itertools19 min
Data Structures in Practice
6 lessonsApplied data structures are concrete ways to organize data so particular operations are easier or less costly.
- Arrays & Linked Lists17 min
- HashMaps16 min
- Stacks, Queues & Heaps17 min
- Binary Search Trees18 min
- Recursion16 min
- Sorting Algorithms17 min
Files, Paths & Encodings
6 lessonsFile handling moves data between a program and storage. An encoding specifies how text is represented as bytes.
- pathlib25 min
- Reading & Writing, Text and Binary27 min
- Writing Your Own Context Manager29 min
- Unicode, str and bytes29 min
- Bytes, Buffers & struct29 min
- Capstone — The Yard45 min
Serialisation & Storage
5 lessonsSerialization converts values into a format that can be stored or transmitted. Storage keeps those representations for later use.
Text & Patterns
5 lessonsA text pattern describes a shape to find in a string. A regular expression is one language for writing such patterns.
Modules, Environments & Packaging
3 lessonsA module is a unit of importable Python code. Packaging describes how code, metadata and dependencies are distributed and installed.
Failure & Observability
3 lessonsFailure handling decides how a program responds when an operation cannot finish. Logging records events that help explain what happened.
- The Hierarchy, `raise from` & `finally`33 min
- Logging31 min
- Capstone — The Black Box45 min
Testing & Debugging
7 lessonsTesting compares observed behavior with an explicit expectation. Debugging investigates why the behavior differs from that expectation.
Frameworks & Tooling
6 lessonsA framework supplies reusable structure for an application. Development tools help manage its dependencies, check its code and run its work.
- Package Managers19 min
- The Static Typing Ecosystem20 min
- Choosing a Web Framework20 min
- Threads and the GIL30 min
- Multiprocessing and Asyncio40 min
- Formatters, Linters and Docs19 min
Capstone — Quarry
1 lessonsAn end-to-end data pipeline takes raw input through parsing, validation, transformation and storage to a useful result.