Bite-sized lessons with a built-in code editor. Every example is editable, every exercise auto-checks your output. Built for people who learn by doing.
# Welcome to py.run ๐
languages = ["Python", "JavaScript", "Rust"]
for lang in languages:
print(f"Hello from {lang}!")
print(f"\n{len(languages)} languages, 1 mission:")
print("โ make you fluent in Python.")Hello from Python! Hello from JavaScript! Hello from Rust! 3 languages, 1 mission: โ make you fluent in Python.
Reading a book about swimming won't make you a swimmer. Same with code.
A full Python interpreter ships with the page. No installs, no servers โ your code executes locally in milliseconds.
Each lesson focuses on one idea, shows it in action, then hands you the keyboard. You'll be writing code in minute one.
Every exercise checks your output against the expected answer. Get instant feedback. Move at your own pace.
From "Hello, World!" to functions and data structures. Take it in order or jump around.
Start from scratch. Variables, types, input, output. Run code right in your browser.
4 lessons โ
If statements, loops, and the logic that makes programs think.
3 lessons โ
Lists, tuples, dicts, sets โ the containers that hold your data.
3 lessons โ
Package logic into reusable pieces. Import the standard library.
2 lessons โ
Classes, objects, inheritance, dunder methods, and properties.
3 lessons โ
Handle exceptions gracefully and work with files.
3 lessons โ
Python's most powerful expressive tools.
4 lessons โ
Type hints, dataclasses, pattern matching, and async.
5 lessons โ
itertools, functools, partial application, and pure-function patterns.
3 lessons โ
Threads, processes, asyncio gather, and the GIL explained.
8 lessons โ
unittest, assertions, doctest, and disciplined debugging.
3 lessons โ
Pattern matching, capture groups, and parsing structured text.
3 lessons โ
JSON, CSV, datetime, and talking to web APIs.
4 lessons โ
Descriptors, metaclasses, and bending Python to your will.
3 lessons โ
Counter, defaultdict, deque, namedtuple, heapq, bisect, enum.
9 lessons โ
Generics, TypedDict, Literal, Protocol โ write code your IDE understands.
6 lessons โ
Properties, classmethods, slots, MRO, abstract base classes, walrus.
6 lessons โ
partial, contextmanager decorator, string translation, walrus.
3 lessons โ
logging, argparse, pickle, hashlib, secrets, statistics.
6 lessons โ
Topics the in-browser sandbox can't run: multiprocessing, subprocess, sockets.
8 lessons โ
Real-world advanced Python: LRU caches, retries, observers, descriptors, DI, toposort, safe eval, async queues.
9 lessons โ
Free, in your browser, no signup required to start. Sign in only when you want to save your progress.
Start lesson 1