Free 38 lessons · 36 modules · real Python 3.12 runtime

Learn Python the way
professionals actually work.

A complete path from your first print() to decorators, asyncio and production tooling — with runnable examples, tested challenges and guides for setting up Python on your own machine.

Today: 
38
Lessons
36
Modules
20
Challenges
0
Installs needed
hello.py
from collections import Counter

def top_word(text: str) -> str:
    words = Counter(text.lower().split())
    return words.most_common(1)[0][0]

story = "to be or not to be that is the question"
print(f"most common word: {top_word(story)!r}")

scores = {"Ada": 97, "Linus": 88, "Guido": 99}
honours = {n: "distinction" for n, s in scores.items() if s >= 90}
print(honours)
$ python hello.py
most common word: 'be'
{'Ada': 'distinction', 'Guido': 'distinction'}
0
Structured lessons
0
Module guides
0
Tested challenges
0
Free & open
How it works

Three steps from zero to shipped

No prior experience needed. Every step has a dedicated guide with the exact commands to run.

STEP 01

Set up Python

Install Python on Windows, macOS or Linux in about 10 minutes — installer, CLI commands, PATH fixes and your first project.

Open the setup guide
STEP 02

Follow the curriculum

38 lessons in 11 tracks — syntax, data structures, OOP, decorators, asyncio, typing, testing — each with runnable examples.

Start lesson one
STEP 03

Build & ship

Solve 20 challenges against hidden tests, then put this whole site online yourself with a single Vercel command.

Read the deploy guide
Curriculum

Eleven tracks, one clear path

Every track builds on the last. Mark lessons complete and your progress is saved in the browser.

01

Foundations

Syntax, types, input/output — the absolute basics

02

Control Flow

Branching, looping, match statements, flow control

03

Data Structures

Lists, tuples, dicts, sets and comprehensions

04

Functions

Arguments, closures, modules and imports

05

Files & Errors

File I/O, JSON, context managers, exceptions

06

Object-Oriented

Classes, inheritance, properties, dunder methods

07

Functional

Decorators, generators, iterators, lambdas

08

Concurrency

Threading, multiprocessing and asyncio

09

Pro Python

Typing, design patterns, testing, metaclasses

10

Practical Apps

APIs, databases, automation, data analysis, web

11

Tooling

pip, venv, packaging and project structure

Why PyMastery

Built like a course, not a blog

Everything here is functional: code really runs, tests really verify, progress really saves.

Real Python, in your browser

The playground and every challenge run on CPython 3.12 compiled to WebAssembly — the same language, no server, no install.

Practical, not theoretical

Each of the 36 module guides shows concrete applications — parsing JSON logs, hashing passwords, calling APIs, reading CSVs.

Challenges with hidden tests

Write your solution, press Run, and your code is executed against real assertions. Passing means passing.

Hints only when you ask

Solutions stay hidden until you press the button. Try first, read the hint second, study the reference answer last.

Progress that sticks

Completed lessons and solved challenges are stored locally in your browser — no account, no tracking, no server.

Every screen, every device

A responsive layout tuned from 320 px phones to ultrawide monitors, with keyboard shortcuts for power users.

Module library

The standard library, explained

36 guides with runnable examples — from math to asyncio.

Browse all 36
Practice

Prove it with working code

20 interview-style challenges, verified by a live Python runtime.

All challenges
FAQ

Questions, answered

No. The playground and all 20 challenges run a real CPython 3.12 interpreter inside your browser (via WebAssembly), so you can learn right now. Installing Python locally is still the right move for real projects — the setup guide walks you through it in about 10 minutes.
Any actively supported version — 3.12 or 3.13 are ideal. Check what you have with python --version (Windows) or python3 --version (macOS/Linux). All lessons follow modern, idiomatic Python.
When you press “Run tests”, your editor code and the challenge's private assertions are executed together in your browser. If every assertion passes, a green badge appears and the challenge is marked solved. Nothing is sent to a server.
Yes — completed lessons and solved challenges are stored in your browser's localStorage. No account is needed and nothing leaves your device. Each page offers a reset button if you want a fresh start.
Yes. The layout adapts from small phones to desktop; editors, modals and navigation are all touch-friendly. The only difference is screen size — the same code, tests and progress tracking work everywhere.
Absolutely — that's the point. It's a plain static site, so the Vercel guide covers both the CLI route (vercel --prod) and the GitHub dashboard route, plus custom domains and troubleshooting.