// LEARN · LANGUAGES & FRAMEWORKS
Python
A practical Python course from installing Python to typing, concurrency and publishing a package. Every example is run and checked against Python 3.14.
Level: Beginner to advanced · For: Anyone who wants to program in Python, from a first script to production code. No experience needed.
Syllabus
Beginner
Complete
After this level you can
- Install Python 3.14, run a script and use the interactive interpreter
- Write programs with variables, numbers, strings, lists, conditions, loops and match
- Define and call functions with default, keyword, positional-only and keyword-only parameters
- Choose between list, tuple, set and dict, and explain names versus objects, copies and the mutable-default trap
- Split code into modules, read and write text and JSON files, and handle the common exceptions
B1First steps5 of 5 written · 5 lessonsBrowser and your computer
Install Python, use the REPL as a calculator, work with numbers, text and lists, and write a first loop
You build: A tip calculator
B2Control flow5 of 5 written · 5 lessonsRuns in your browser
Branch with if and match, and loop with for, range, while, break, continue and else on loops
You build: FizzBuzz variants and a menu with match
B3Functions5 of 5 written · 5 lessonsRuns in your browser
Define functions with defaults, keyword and special parameters, *args and **kwargs, lambdas, docstrings and annotations
You build: A unit converter library
B4Data structures6 of 6 written · 6 lessonsRuns in your browser
Use lists, deques, comprehensions, tuples, sets and dicts, and know when two names share one object
You build: A word-frequency counter
B5Modules, files and errors5 of 5 written · 5 lessonsRuns in your browser
Import and write modules, format with f-strings, read and write files and JSON, and handle and raise exceptions
You build: A JSON to-do file manager
Beginner project
Expense tracker
Add, list and summarise expenses by category and month, stored in a JSON file, with tests for a missing and a corrupt file.
Runs in your browserSelf-checked against a rubric
Open the project guideIntermediate
Complete
After this level you can
- Design error handling with custom exceptions, chaining, finally, context managers and exception groups
- Model a domain with classes, inheritance, dataclasses and enum, and explain scopes and namespaces
- Write iterators and generators, and use itertools, functools and collections idiomatically
- Build a command-line tool with argparse, pathlib, re, datetime, csv and logging
- Test with unittest, unittest.mock and doctest, and manage a project with venv, pip and pyproject.toml
I1Errors in depth5 of 5 written · 5 lessonsRuns in your browser
Chain exceptions, write custom ones, clean up with finally and with, and handle exception groups
You build: A retrying file reader
I2Classes6 of 6 written · 6 lessonsRuns in your browser
Use scopes, classes, inheritance and the MRO, private names, dataclasses and enum
You build: A bank-account model with dataclasses
I3Iteration and functional tools6 of 6 written · 6 lessonsRuns in your browser
Write iterators and generators, and use itertools, functools and collections
You build: A lazy CSV pipeline
I4The standard library for real programs6 of 6 written · 6 lessonsBrowser and your computer
Use pathlib, argparse, sys, re, datetime, csv and logging in a real program
You build: A command-line log grep
I5Testing and project tooling5 of 5 written · 5 lessonsBrowser and your computer
Test with unittest, mock and doctest, and set up a project with venv, pip and pyproject.toml
You build: A tested, installable package skeleton
Intermediate project
Log analyser
A command-line tool that parses log files, aggregates them, writes CSV or JSON, logs its progress and installs as a console script.
Runs on your computerSelf-checked against a rubric
Open the project guideAdvanced
Complete
After this level you can
- Implement Python protocols through special methods and descriptors, and control attribute access and class creation
- Type a codebase with generics, Protocol, TypedDict and overloads, and check it with mypy
- Choose between threads, processes and asyncio for a workload, and write structured async code
- Measure and improve performance, and handle floating-point and decimal arithmetic correctly
- Use template strings and tomllib, avoid the common security pitfalls and publish a package
A1The data model6 of 6 written · 6 lessonsRuns in your browser
Implement special methods, operators, container and context protocols, descriptors and metaclasses
You build: A Vector and Matrix type with operators
A2Typing6 of 6 written · 6 lessonsBrowser and your computer
Type code with generics, Protocol, TypedDict, Literal and overloads, and read annotations at runtime
You build: Typing an untyped module until mypy is clean
A3Concurrency6 of 6 written · 6 lessonsRuns on your computer
Choose between threads, processes and asyncio, and use TaskGroup and timeouts
You build: A concurrent file hasher compared across the three models
A4Performance and numbers5 of 5 written · 5 lessonsBrowser and your computer
Measure with timeit and cProfile, and handle floats, decimal and weak references
You build: Making a slow report ten times faster, measured
A5Modern Python and safe code5 of 5 written · 5 lessonsBrowser and your computer
Use template strings, tomllib and sqlite3 safely, avoid eval, pickle and shell=True, and publish a package
You build: A safe report generator using template strings
Advanced project
Async job runner
An asyncio runner with TaskGroup, per-job timeouts, retries with backoff and cancellation, fully typed and profiled.
Runs on your computerSelf-checked against a rubric
Open the project guideCapstone
Capstone
Personal library manager
An installable package with a command line, a typed domain model, sqlite3 storage, TOML configuration, logging and a test suite.
Runs on your computerSelf-checked against a rubric
Open the project guideSources
- The Python Tutorial (Python 3.14 documentation)
- Using the Python Interpreter (The Python Tutorial, 3.14)
- Using Python on Windows (Python 3.14)
- Using Python on macOS (Python 3.14)
- Using Python on Unix platforms (Python 3.14)
- Command line and environment (Python 3.14)
- Built-in Functions: property (Python 3.14)
- An Informal Introduction to Python: First Steps Towards Programming (The Python Tutorial, 3.14)
- Data Structures: Using Lists as Queues (The Python Tutorial, 3.14)
- More Control Flow Tools: Keyword-Only Arguments, Documentation Strings (The Python Tutorial, 3.14)
- Built-in Types: Set Types, set and frozenset (Python 3.14)
- Expressions: Generator expressions (The Python Language Reference, 3.14)
- More Control Flow Tools: for Statements and the range() Function (The Python Tutorial, 3.14)
- Data Structures: Looping Techniques (The Python Tutorial, 3.14)
- More Control Flow Tools: break and continue Statements (The Python Tutorial, 3.14)
- More Control Flow Tools: else Clauses on Loops (The Python Tutorial, 3.14)
- More Control Flow Tools: pass Statements (The Python Tutorial, 3.14)
- More Control Flow Tools: match Statements (The Python Tutorial, 3.14)
- Built-in Types: str.split (Python 3.14)
- Built-in Types: String Methods, str.isdigit and str.split (Python 3.14)
- Compound statements: except* clause (The Python Language Reference, 3.14)
- Glossary: decorator (Python 3.14)
- Built-in Functions: all, any (Python 3.14)
- PEP 8: Style Guide for Python Code
- Errors and Exceptions: Raising and Handling Multiple Unrelated Exceptions (The Python Tutorial, 3.14)
- Built-in Exceptions: ValueError (Python 3.14)
- Floating-Point Arithmetic: Issues and Limitations (The Python Tutorial, 3.14)
- Built-in Types: Iterator Types (Python 3.14)
- collections: deque objects (Python 3.14)
- Simple statements: Assignment statements (The Python Language Reference, 3.14)
- Programming FAQ: Why am I getting an UnboundLocalError? (Python 3.14)
- copy: Shallow and deep copy operations (Python 3.14)
- Data model: Objects, values and types (Python 3.14)
- Modules (The Python Tutorial, 3.14)
- __main__: Top-level code environment (Python 3.14)
- Input and Output: Saving structured data with json (The Python Tutorial, 3.14)
- string: Format Specification Mini-Language (Python 3.14)
- json: JSON encoder and decoder (Python 3.14)
- Built-in Exceptions: add_note and ExceptionGroup (Python 3.14)
- contextlib: Utilities for with-statement contexts (Python 3.14)
- Classes: Generator Expressions (The Python Tutorial, 3.14)
- Execution model: Resolution of names (The Python Language Reference, 3.14)
- dataclasses: Data Classes (Python 3.14)
- enum: Support for enumerations (Python 3.14)
- Enum HOWTO (Python 3.14)
- itertools: Functions creating iterators for efficient looping (Python 3.14)
- functools: Higher-order functions and operations on callable objects (Python 3.14)
- csv: CSV File Reading and Writing (Python 3.14)
- pathlib: Object-oriented filesystem paths (Python 3.14)
- argparse: Parser for command-line options, arguments and subcommands (Python 3.14)
- sys: System-specific parameters and functions (Python 3.14)
- re: Regular expression operations (Python 3.14)
- datetime: Basic date and time types (Python 3.14)
- logging: Logging facility for Python (Python 3.14)
- Logging HOWTO (Python 3.14)
- unittest: Basic concepts (Python 3.14)
- unittest.mock: mock object library (Python 3.14)
- doctest: Test interactive Python examples (Python 3.14)
- Virtual Environments and Packages (Python 3.14)
- venv: Creation of virtual environments (Python 3.14)
- Writing your pyproject.toml (Python Packaging User Guide)
- src layout vs flat layout (Python Packaging User Guide)
- Installing Packages (Python Packaging User Guide)
- tomllib: Parse TOML files (Python 3.14)
- Data model: Basic customization (The Python Language Reference, 3.14)
- Data model: Emulating numeric types (The Python Language Reference, 3.14)
- functools: total_ordering (Python 3.14)
- Data model: Emulating container types (The Python Language Reference, 3.14)
- collections.abc: Abstract Base Classes for Containers (Python 3.14)
- Data model: With Statement Context Managers (The Python Language Reference, 3.14)
- Compound statements: The with statement (The Python Language Reference, 3.14)
- Descriptor Guide (Python HOWTOs, 3.14)
- Data model: Implementing Descriptors (The Python Language Reference, 3.14)
- Data model: Customizing attribute access (The Python Language Reference, 3.14)
- Data model: Customizing class creation (The Python Language Reference, 3.14)
- Data model: Metaclasses (The Python Language Reference, 3.14)
- typing: Support for type hints (Python 3.14)
- Glossary: type hint (Python 3.14)
- Built-in Types: Generic Alias Type (Python 3.14)
- Compound statements: Type parameter lists (The Python Language Reference, 3.14)
- Simple statements: The type statement (The Python Language Reference, 3.14)
- typing: Protocol and runtime_checkable (Python 3.14)
- abc: Abstract Base Classes (Python 3.14)
- typing: TypedDict (Python 3.14)
- typing: Literal (Python 3.14)
- typing: Final and final (Python 3.14)
- typing: @overload (Python 3.14)
- typing: TypeIs and TypeGuard (Python 3.14)
- annotationlib: Functionality for introspecting annotations (Python 3.14)
- Annotations Best Practices (Python 3.14)
- threading: Thread-based parallelism (Python 3.14)
- Python support for free threading (Python HOWTOs, 3.14)
- What’s new in Python 3.14: free-threaded Python is officially supported
- sys: sys._is_gil_enabled (Python 3.14)
- Glossary: global interpreter lock, race condition (Python 3.14)
- multiprocessing: Process-based parallelism (Python 3.14)
- pickle: What can be pickled and unpickled? (Python 3.14)
- concurrent.futures: Launching parallel tasks (Python 3.14)
- Coroutines and tasks (Python 3.14)
- Runners: asyncio.run (Python 3.14)
- Developing with asyncio (Python 3.14)
- Subprocesses (Python 3.14)
- Coroutines and tasks: task groups, cancellation and timeouts (Python 3.14)
- asyncio exceptions (Python 3.14)
- Synchronization primitives: Semaphore and Event (Python 3.14)
- Concurrent Execution (Python 3.14)
- hashlib: Secure hashes and message digests (Python 3.14)
- time: time.perf_counter (Python 3.14)
- Coroutines and tasks: running in threads (Python 3.14)
- Python support for free threading (Python HOWTOs, 3.14)
- timeit: Measure execution time of small code snippets (Python 3.14)
- The Python Profilers: profile, cProfile and pstats (Python 3.14)
- Design and History FAQ: how lists and dictionaries are implemented (Python 3.14)
- math.isclose (Python 3.14)
- Built-in Functions: round (Python 3.14)
- decimal: Decimal fixed-point and floating-point arithmetic (Python 3.14)
- fractions: Rational numbers (Python 3.14)
- weakref: Weak references (Python 3.14)
- string.templatelib: Support for template string literals (Python 3.14)
- What's new in Python 3.14: PEP 750, template string literals
- sqlite3: How to use placeholders to bind values in SQL queries (Python 3.14)
- sqlite3: Tutorial and transaction control (Python 3.14)
- sqlite3: How to use the connection context manager (Python 3.14)
- ast.literal_eval (Python 3.14)
- Built-in functions: eval (Python 3.14)
- pickle: Python object serialization (Python 3.14)
- subprocess: Security Considerations (Python 3.14)
- secrets: Generate secure random numbers for managing secrets (Python 3.14)
- hmac: Keyed-Hashing for Message Authentication (Python 3.14)
- Packaging Python Projects (Python Packaging User Guide)