Learn Python
A free course in four tracks. Start with Python if the language is new to you; the FastAPI, Django and FastMCP tracks assume you know functions, classes, modules and exceptions. Each chapter is one page with worked examples and a practice task, and takes about 10 to 15 minutes to study.
Python
The language and its standard library, from the first script to generators, threads, processes and asyncio.
- Foundations1. Install Python, run a script and set up a projectInstall Python 3, check which interpreter runs your code, write and run a first script, read a traceback, and isolate dependencies with venv or uv.14 min study
- Foundations2. Python variables, input and numbers: int, float and boolHow names refer to objects, why input() always returns text, how to convert it, and how Python integers, floats, rounding and division really behave.14 min study
- Foundations3. Python if, elif, else and loops: for, while, range and breakConditions and truthiness, if/elif/else, the conditional expression, for and while loops, range, enumerate, break, continue, loop else and the walrus operator.15 min study
- Foundations4. Python lists and tuples: slicing, copying, comprehensions, zipIndex and slice sequences, change lists safely, tell aliases from copies, build lists with comprehensions, unpack values, zip with strict=True and sort.14 min study
- Foundations5. Python dictionaries and sets: lookups, grouping and countingBuild and update dictionaries, tell a missing key from a stored None, group and count records with setdefault, defaultdict and Counter, and use set operations.14 min study
- Foundations6. Python strings: cleaning, searching, regex and f-stringsUnicode strings and bytes, escapes and raw strings, strip, split and join, case-insensitive search, regular expressions with re, and f-string format specs.13 min study
- Functions and program design7. Python functions: parameters, return values and type hintsDefine and call functions, return results instead of printing, use keyword-only and default arguments safely, *args and **kwargs, type hints and docstrings.14 min study
- Functions and program design8. Python lambdas, scope, closures and decorators explainedPass functions as values, use lambda, map, filter and partial, understand LEGB scope, build closures and write decorators, including ones with arguments.15 min study
- Functions and program design9. Python exceptions: try, except, raise, logging and pdbCatch the exceptions you expect, use else and finally, raise custom errors with causes, log failures, test error paths and debug with pdb.15 min study
- Functions and program design10. Python modules, packages, argparse and timeitSplit code into modules and packages, understand import caching and __main__, build a command line with argparse, and measure speed with timeit.14 min study
- Objects and structured matching11. Python classes: attributes, properties, methods and dataclassesWrite classes with __init__ and methods, validate with properties, add alternative constructors, and use dataclasses and enums.15 min study
- Objects and structured matching12. Python inheritance, composition, protocols and operatorsSubclass with super(), prefer composition where it fits, define interfaces with ABC and Protocol, overload operators and support len, in and for.15 min study
- Objects and structured matching13. Python match and case: structural pattern matching by exampleMatch literals, sequences, dicts and objects with match/case, add guards, capture with as, avoid the capture trap and know when if is simpler.15 min study
- Files and standard-library workflows14. Python files and pathlib: read, write, stream and replace safelyBuild paths with pathlib, choose open modes and encodings, stream large text files line by line, handle bytes, walk folders and replace files atomically.15 min study
- Files and standard-library workflows15. Python CSV, JSON, TOML, SQLite and ZIP filesRead and write CSV, JSON with dates, TOML config with tomllib, records in SQLite with query parameters, and ZIP archives, all with the standard library.14 min study
- Files and standard-library workflows16. Python math, statistics, decimal, random and secrets modulesRound with floor and ceil, compare floats, summarize data with statistics, calculate money with Decimal, simulate with random and make tokens with secrets.11 min study
- Files and standard-library workflows17. Python datetime and zoneinfo: dates, time zones, timestampsChoose date, datetime or timedelta, store aware UTC timestamps, parse ISO 8601, handle daylight saving, add months and time code with monotonic clocks.12 min study
- Iteration and concurrency18. Python iterators, generators, itertools and context managersHow iteration works, generators with yield, generator expressions, streaming pipelines, itertools such as batched and groupby, and context managers.14 min study
- Iteration and concurrency19. Python threading: locks, queues and ThreadPoolExecutorWhen to use threads, processes or asyncio, starting and joining threads, race conditions and locks, queues and events, thread pools with futures, and the GIL.15 min study
- Iteration and concurrency20. Python multiprocessing: process pools, queues, shared stateRun CPU-bound Python on several cores with ProcessPoolExecutor, the __main__ guard, start methods, chunking, queues, pipes and shared values.15 min study
- Iteration and concurrency21. Python asyncio: async, await, TaskGroup, timeouts and queuesWrite coroutines with async and await, run tasks with TaskGroup, handle failures with except*, limit concurrency, set timeouts and avoid blocking.15 min study
FastAPI
HTTP APIs with typed request and response models, from routing to a database.
- HTTP basics1. FastAPI tutorial: first app, routes, path and query parametersInstall FastAPI, write a first API, map methods and paths to functions, validate path and query parameters, read 422 errors and test routes.13 min study
- HTTP basics2. FastAPI request body and response models with PydanticValidate JSON bodies with Pydantic models, Field constraints, nested models and validators, filter output with response_model and design PATCH.13 min study
- HTTP basics3. FastAPI responses: status codes, errors, files, cookiesChoose status codes, raise HTTPException and custom error handlers, return HTML, files and streams, redirect correctly, and use headers and cookies.15 min study
- HTTP basics4. FastAPI forms, Jinja2 templates, file uploads and static filesHandle HTML form posts with Form(), re-render templates with errors, redirect with 303, accept file uploads with UploadFile and serve CSS with StaticFiles.15 min study
- Building an API5. FastAPI CRUD API: routers, dependencies, 404, 409, PATCHBuild a create, read, update and delete API with APIRouter, Depends, pagination, Location headers, 404 and 409 errors and safe PATCH merging.15 min study
- Building an API6. FastAPI with SQLAlchemy: models, sessions and testingStore FastAPI data with SQLAlchemy 2: typed ORM models, a session per request, commits and IntegrityError, lifespan setup, migrations and tests.15 min study
Django
Server-rendered web applications with templates, an ORM and forms, built step by step.
- Project and pages1. Django tutorial: install, create a project and your first appInstall Django, create a project and an app, learn settings, URLs and views, run migrations and the dev server, and follow one request.11 min study
- Project and pages2. Django URLs and views: converters, query strings, JSONRoute URLs to Django views with path converters, read query strings, return JSON and 404s, restrict HTTP methods, redirect with reverse, and set cookies.13 min study
- Project and pages3. Django templates: inheritance, includes, filters, staticRender HTML with Django templates: render() and context, base templates and blocks, includes, filters, auto-escaping, static CSS and TemplateView.12 min study
- Data4. Django models and migrations: fields, choices, adminDefine Django models with fields, choices and validators, create tables with migrations, learn null versus blank, add constraints and use the admin.12 min study
- Data5. Django QuerySets: filter, lookups, aggregates and transactionsQuery Django models with filter, lookups and Q objects, understand lazy QuerySets, aggregate and annotate, update with F and use atomic transactions.13 min study
- Data6. Django relationships: ForeignKey, ManyToMany, N+1 queriesLink Django models with ForeignKey, ManyToManyField and a through model, pick on_delete rules, query across relations and fix N+1 queries.11 min study
- Forms and editing7. Django forms: fields, validation, clean methods and CSRFBuild Django forms with typed fields, validate with clean methods, handle bound and unbound forms, render errors, use CSRF tokens and messages.13 min study
- Forms and editing8. Django CRUD with ModelForm and generic class-based viewsCreate, list, edit and delete Django models with ModelForm and generic views like ListView and CreateView, with permissions and messages.14 min study
FastMCP
Model Context Protocol servers in Python: tools, resources, prompts, testing and HTTP.
- Protocol and capabilities1. FastMCP tutorial: what MCP is and your first serverLearn the Model Context Protocol's hosts, clients and servers, its tools, resources and prompts, then build and call a first FastMCP server in Python.10 min study
- Protocol and capabilities2. FastMCP tools: validated arguments, results and errorsDesign FastMCP tools with typed, constrained arguments, structured results and clear tool errors, then test success and failure paths with a client.13 min study
- Protocol and capabilities3. FastMCP resources, resource templates and promptsPublish readable MCP resources and URI templates with FastMCP, write reusable prompts, and keep content separate from instructions.12 min study
- Testing and deployment4. Testing FastMCP servers in memory and over stdioTest FastMCP servers with an in-memory client and pytest, run the same server as a stdio subprocess, and diagnose failures by boundary.12 min study
- Testing and deployment5. FastMCP over HTTP with JWT authentication and scopesServe FastMCP over Streamable HTTP, verify JWT bearer tokens, restrict tools by scope, and test reader and editor access.14 min study
- Testing and deployment6. FastMCP and FastAPI sharing one SQLite databaseShare a persistent SQLite catalog between a FastMCP server and a FastAPI app, wire lifespans together and keep blocking I/O off the event loop.13 min study