← Back to courses

Course

Core Python

75 lessons across 13 modules

One topic per lesson, from the interpreter to async. Each written lesson carries its own objectives, examples, common mistakes, exercises, a coding challenge, a quiz, and interview questions.

Course13 modules75 lessonsEach heading below is a module (one topic). Each card under it is a lesson. Start with Module 1.
Solid: ready (20)Dashed: coming soon (55)
Module 1 of 137 lessons

Python Foundations

From installing Python to strings and formatting

Module 2 of 137 lessons

Operators and Control Flow

Deciding what runs, and how many times

Module 3 of 138 lessons6 ready

Python Collections

Lists, tuples, sets, dicts, and comprehensions

Module 4 of 137 lessonsComing soon

Functions

Naming a piece of behaviour and reusing it

Functions Basics

23

def, parameters, arguments, return values, and local names.

Extracting a repeated calculation into add(a, b)

Lesson 23planned

Function Arguments

24

Positional, keyword, default, and the order they must appear in.

Why a mutable default argument is a trap

Lesson 24planned

*args and **kwargs

25

Variable-length arguments and unpacking at the call site.

Writing a function that totals however many numbers it gets

Lesson 25planned

Scope and LEGB

26

Local, enclosing, global, built-in - and global vs nonlocal.

Why assigning to a name makes it local everywhere in the function

Lesson 26planned

Lambda Functions

27

Anonymous functions, and using them with sorted, map, and filter.

Sorting a list of dicts by one key

Lesson 27planned

Higher-Order Functions

28

Functions as values: passing them, returning them, map/filter/reduce.

A function that builds another function

Lesson 28planned

Recursion

29

Base case, recursive case, the call stack, and where it runs out.

Walking a nested dictionary of unknown depth

Lesson 29planned
Module 5 of 136 lessonsComing soon

Object-Oriented Python

Classes, inheritance, and dunder methods

Classes and Objects

30

Classes, instances, attributes, methods, self, and __init__.

A User class that knows its own name

Lesson 30planned

Instance and Class Attributes

31

Instance vs class state, classmethod, and staticmethod.

A counter shared across every instance

Lesson 31planned

Encapsulation

32

Public, _protected, __private, name mangling, and @property.

Validating an email every time it is set

Lesson 32planned

Inheritance

33

Parent and child classes, overriding, super(), and multiple inheritance.

A PremiumUser that extends User without copying it

Lesson 33planned

Polymorphism and Abstraction

34

Duck typing, ABC, abstractmethod, and interfaces in Python.

Three payment classes, one pay() call site

Lesson 34planned

Dunder Methods

35

__str__, __repr__, __len__, __eq__, __lt__, __add__, __iter__.

Making your class work with print(), len(), and ==

Lesson 35planned
Module 6 of 133 lessonsComing soon

Errors and Exception Handling

Failing on purpose, and failing well

Exceptions

36

Syntax vs runtime errors, the common built-ins, and reading a traceback.

Reading a traceback from the bottom up

Lesson 36planned

Exception Handling

37

try, except, else, finally, and the exception hierarchy.

Why bare except: hides the bug you are looking for

Lesson 37planned

Custom Exceptions

38

raise, custom exception classes, and designing an error API.

A ValidationError your callers can actually catch

Lesson 38planned
Module 7 of 134 lessonsComing soon

Files and Data

Getting data in and out of your program

File Handling

39

open(), read, write, append, file modes, and encoding.

Reading a file that is too big to hold in memory

Lesson 39planned

Context Managers

40

with, resource cleanup, and why it beats try/finally.

The file that stayed open and locked

Lesson 40planned

JSON

41

dumps, loads, dump, load, and the Python-to-JSON type mapping.

Saving a settings dict and reading it back

Lesson 41planned

CSV

42

reader, writer, DictReader, DictWriter, and header handling.

Processing a spreadsheet export row by row

Lesson 42planned
Module 8 of 134 lessonsComing soon

Modules and Packages

Splitting a program across files

Modules

43

import, from-import, aliases, and how Python finds a module.

Splitting one long script into three files

Lesson 43planned

Packages

44

Package structure, __init__.py, absolute and relative imports.

Turning a folder of scripts into an importable package

Lesson 44planned

__name__ and __main__

45

What the guard does, and how a file behaves when imported.

Why your script ran twice

Lesson 45planned

Virtual Environments and pip

46

venv, pip, requirements files, and dependency management.

Two projects needing two versions of the same library

Lesson 46planned
Module 9 of 136 lessonsComing soon

Intermediate Core Python

Iterators, generators, decorators, closures

Iterators

47

Iterable vs iterator, iter(), next(), and the iterator protocol.

Writing a class you can put in a for loop

Lesson 47planned

Generators

48

yield, lazy evaluation, generator expressions, and memory.

Reading a million-line file without loading it

Lesson 48planned

Decorators

49

Wrapper functions, @syntax, arguments, and functools.wraps.

A @timed decorator you can put on any function

Lesson 49planned

Closures

50

Nested functions, free variables, and nonlocal.

A counter that remembers without a global

Lesson 50planned

Advanced Context Managers

51

__enter__, __exit__, and contextlib.

A context manager that rolls back on failure

Lesson 51planned

Dataclasses

52

@dataclass, fields, defaults, frozen, and comparison.

Replacing thirty lines of __init__ and __repr__ with one line

Lesson 52planned
Module 10 of 137 lessonsComing soon

The Standard Library

The batteries Python ships with

datetime

53

date, time, datetime, timedelta, formatting, parsing, time zones.

Working out how long ago something happened

Lesson 53planned

collections

54

Counter, defaultdict, deque, namedtuple.

Counting word frequency in one line

Lesson 54planned

itertools

55

chain, product, permutations, combinations, groupby, islice.

Pairing every item with every other item

Lesson 55planned

functools

56

reduce, partial, lru_cache, wraps.

Caching an expensive call with one decorator

Lesson 56planned

os and pathlib

57

Filesystem operations, paths, and environment variables.

Why pathlib beats string concatenation for paths

Lesson 57planned

sys

58

Command-line arguments, sys.path, stdin/stdout, exit codes.

Making a script take arguments

Lesson 58planned

re - Regular Expressions

59

Patterns, character classes, quantifiers, groups, search, sub.

Validating and extracting from messy text

Lesson 59planned
Module 11 of 135 lessonsComing soon

Engineering Practices

Writing Python other people can work with

Type Hints

60

Annotations, list[str], dict[str, int], Optional, Union, Callable.

Catching a bug before you run the program

Lesson 60planned

Pythonic Code

61

EAFP vs LBYL, enumerate, zip, unpacking, any, all.

The same loop, written the way Python expects

Lesson 61planned

Debugging

62

Reading tracebacks, print debugging, breakpoint(), and a workflow.

Finding the line that actually broke

Lesson 62planned

Testing Basics

63

Why test, unittest, assertions, and Arrange/Act/Assert.

Your first test, and what it protects

Lesson 63planned

Logging

64

Log levels, the logging module, formatters, handlers, files.

Replacing print() with something you can turn down

Lesson 64planned
Module 12 of 137 lessonsComing soon

Advanced Core Python

Memory, performance, and concurrency

Memory Management

65

Objects, references, reference counting, and garbage collection.

Why two variables changed together

Lesson 65planned

Copying Objects

66

Assignment vs shallow copy vs deep copy.

copy.deepcopy() and when you actually need it

Lesson 66planned

Python Performance

67

Complexity basics, list vs set vs dict, laziness, timeit.

Turning an O(n^2) loop into an O(n) lookup

Lesson 67planned

Concurrency Concepts

68

Process, thread, async, I/O-bound vs CPU-bound, and the GIL.

Choosing the right tool before writing any code

Lesson 68planned

Threading

69

Threads, locks, race conditions, and thread pools.

Two threads, one counter, wrong answer

Lesson 69planned

Multiprocessing

70

Processes, CPU-bound work, and process pools.

Using every core instead of one

Lesson 70planned

Async Python

71

async, await, coroutines, the event loop, and async I/O.

Fetching fifty URLs in the time one used to take

Lesson 71planned
Module 13 of 134 lessonsComing soon

Practical Python

Putting it together

Environment Variables

72

os.environ, .env files, configuration, and secrets.

Keeping a key out of your source code

Lesson 72planned

Working With APIs

73

HTTP, requests, JSON, headers, status codes, error handling.

Calling a real API and surviving its failures

Lesson 73planned

Building a CLI Application

74

Arguments, subcommands, and a complete small tool.

A todo CLI: add, list, complete, delete

Lesson 74planned

Core Python Project

75

A CSV processing system using everything in the course.

Validate, transform, log, and report on a real file

Lesson 75planned