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.
Python Foundations
From installing Python to strings and formatting
Introduction to Python
1What Python is, how the interpreter runs your code, and your first program.
Variables and Naming
2Assignment, dynamic typing, naming rules, and what a name really points at.
Python Data Types
3int, float, complex, bool, str, NoneType - and checking which is which.
Numbers and Arithmetic
4Arithmetic, floor division, modulo, exponentiation, and operator precedence.
Strings
5Quotes, indexing, slicing, escapes, raw strings, and immutability.
String Methods
6split, join, replace, find, strip, and the family around them.
String Formatting
7f-strings, str.format, number formatting, and alignment.
Operators and Control Flow
Deciding what runs, and how many times
Operators
8Arithmetic, comparison, logical, identity, membership, and bitwise.
Boolean and Truthiness
9True, False, what counts as falsy, and short-circuit evaluation.
if / elif / else
10Conditions, nesting, and conditional expressions.
match-case
11Structural pattern matching, and when it beats a chain of elifs.
for Loops
12Iteration, range, enumerate, and looping over collections.
while Loops
13Conditions, counters, input loops, and avoiding infinite ones.
break, continue and pass
14Loop control, and the mistakes each one invites.
Python Collections
Lists, tuples, sets, dicts, and comprehensions
Lists
15Ordered, mutable, index-based - creating, slicing, changing, and nesting.
List Methods and Operations
16Combine, search, sort, and copy lists - and the methods that return None.
Tuples
17Fixed records, unpacking, and why the comma is what makes a tuple.
Sets
18Unique values, instant membership, and comparing two groups with one operator.
Dictionaries
19Data with names instead of positions: create, read safely, update, remove, and loop over key-value pairs.
Dictionary Patterns
20Counting, grouping, lookups, reverse maps, caches - the handful of dictionary patterns behind most data problems.
List Comprehensions
21Basic form, conditions, nesting, and when not to use one.
Turning a loop of four lines into one readable line
Dictionary and Set Comprehensions
22Building dicts and sets in one expression.
Inverting a dictionary's keys and values
Functions
Naming a piece of behaviour and reusing it
Functions Basics
23def, parameters, arguments, return values, and local names.
Extracting a repeated calculation into add(a, b)
Function Arguments
24Positional, keyword, default, and the order they must appear in.
Why a mutable default argument is a trap
*args and **kwargs
25Variable-length arguments and unpacking at the call site.
Writing a function that totals however many numbers it gets
Scope and LEGB
26Local, enclosing, global, built-in - and global vs nonlocal.
Why assigning to a name makes it local everywhere in the function
Lambda Functions
27Anonymous functions, and using them with sorted, map, and filter.
Sorting a list of dicts by one key
Higher-Order Functions
28Functions as values: passing them, returning them, map/filter/reduce.
A function that builds another function
Recursion
29Base case, recursive case, the call stack, and where it runs out.
Walking a nested dictionary of unknown depth
Object-Oriented Python
Classes, inheritance, and dunder methods
Classes and Objects
30Classes, instances, attributes, methods, self, and __init__.
A User class that knows its own name
Instance and Class Attributes
31Instance vs class state, classmethod, and staticmethod.
A counter shared across every instance
Encapsulation
32Public, _protected, __private, name mangling, and @property.
Validating an email every time it is set
Inheritance
33Parent and child classes, overriding, super(), and multiple inheritance.
A PremiumUser that extends User without copying it
Polymorphism and Abstraction
34Duck typing, ABC, abstractmethod, and interfaces in Python.
Three payment classes, one pay() call site
Dunder Methods
35__str__, __repr__, __len__, __eq__, __lt__, __add__, __iter__.
Making your class work with print(), len(), and ==
Errors and Exception Handling
Failing on purpose, and failing well
Exceptions
36Syntax vs runtime errors, the common built-ins, and reading a traceback.
Reading a traceback from the bottom up
Exception Handling
37try, except, else, finally, and the exception hierarchy.
Why bare except: hides the bug you are looking for
Custom Exceptions
38raise, custom exception classes, and designing an error API.
A ValidationError your callers can actually catch
Files and Data
Getting data in and out of your program
File Handling
39open(), read, write, append, file modes, and encoding.
Reading a file that is too big to hold in memory
Context Managers
40with, resource cleanup, and why it beats try/finally.
The file that stayed open and locked
JSON
41dumps, loads, dump, load, and the Python-to-JSON type mapping.
Saving a settings dict and reading it back
CSV
42reader, writer, DictReader, DictWriter, and header handling.
Processing a spreadsheet export row by row
Modules and Packages
Splitting a program across files
Modules
43import, from-import, aliases, and how Python finds a module.
Splitting one long script into three files
Packages
44Package structure, __init__.py, absolute and relative imports.
Turning a folder of scripts into an importable package
__name__ and __main__
45What the guard does, and how a file behaves when imported.
Why your script ran twice
Virtual Environments and pip
46venv, pip, requirements files, and dependency management.
Two projects needing two versions of the same library
Intermediate Core Python
Iterators, generators, decorators, closures
Iterators
47Iterable vs iterator, iter(), next(), and the iterator protocol.
Writing a class you can put in a for loop
Generators
48yield, lazy evaluation, generator expressions, and memory.
Reading a million-line file without loading it
Decorators
49Wrapper functions, @syntax, arguments, and functools.wraps.
A @timed decorator you can put on any function
Closures
50Nested functions, free variables, and nonlocal.
A counter that remembers without a global
Advanced Context Managers
51__enter__, __exit__, and contextlib.
A context manager that rolls back on failure
Dataclasses
52@dataclass, fields, defaults, frozen, and comparison.
Replacing thirty lines of __init__ and __repr__ with one line
The Standard Library
The batteries Python ships with
datetime
53date, time, datetime, timedelta, formatting, parsing, time zones.
Working out how long ago something happened
collections
54Counter, defaultdict, deque, namedtuple.
Counting word frequency in one line
itertools
55chain, product, permutations, combinations, groupby, islice.
Pairing every item with every other item
functools
56reduce, partial, lru_cache, wraps.
Caching an expensive call with one decorator
os and pathlib
57Filesystem operations, paths, and environment variables.
Why pathlib beats string concatenation for paths
sys
58Command-line arguments, sys.path, stdin/stdout, exit codes.
Making a script take arguments
re - Regular Expressions
59Patterns, character classes, quantifiers, groups, search, sub.
Validating and extracting from messy text
Engineering Practices
Writing Python other people can work with
Type Hints
60Annotations, list[str], dict[str, int], Optional, Union, Callable.
Catching a bug before you run the program
Pythonic Code
61EAFP vs LBYL, enumerate, zip, unpacking, any, all.
The same loop, written the way Python expects
Debugging
62Reading tracebacks, print debugging, breakpoint(), and a workflow.
Finding the line that actually broke
Testing Basics
63Why test, unittest, assertions, and Arrange/Act/Assert.
Your first test, and what it protects
Logging
64Log levels, the logging module, formatters, handlers, files.
Replacing print() with something you can turn down
Advanced Core Python
Memory, performance, and concurrency
Memory Management
65Objects, references, reference counting, and garbage collection.
Why two variables changed together
Copying Objects
66Assignment vs shallow copy vs deep copy.
copy.deepcopy() and when you actually need it
Python Performance
67Complexity basics, list vs set vs dict, laziness, timeit.
Turning an O(n^2) loop into an O(n) lookup
Concurrency Concepts
68Process, thread, async, I/O-bound vs CPU-bound, and the GIL.
Choosing the right tool before writing any code
Threading
69Threads, locks, race conditions, and thread pools.
Two threads, one counter, wrong answer
Multiprocessing
70Processes, CPU-bound work, and process pools.
Using every core instead of one
Async Python
71async, await, coroutines, the event loop, and async I/O.
Fetching fifty URLs in the time one used to take
Practical Python
Putting it together
Environment Variables
72os.environ, .env files, configuration, and secrets.
Keeping a key out of your source code
Working With APIs
73HTTP, requests, JSON, headers, status codes, error handling.
Calling a real API and surviving its failures
Building a CLI Application
74Arguments, subcommands, and a complete small tool.
A todo CLI: add, list, complete, delete
Core Python Project
75A CSV processing system using everything in the course.
Validate, transform, log, and report on a real file