Real Python, in your browser. Zero install.

Learn Python by running it, not reading about it.

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.

98
Lessons
21
Courses
0 min
Setup time
first_program.py
# 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.")
Output
Hello from Python!
Hello from JavaScript!
Hello from Rust!

3 languages, 1 mission:
โ†’ make you fluent in Python.

Built for learning by doing.

Reading a book about swimming won't make you a swimmer. Same with code.

Run code instantly

A full Python interpreter ships with the page. No installs, no servers โ€” your code executes locally in milliseconds.

Concept-sized lessons

Each lesson focuses on one idea, shows it in action, then hands you the keyboard. You'll be writing code in minute one.

Auto-graded exercises

Every exercise checks your output against the expected answer. Get instant feedback. Move at your own pace.

The curriculum.

From "Hello, World!" to functions and data structures. Take it in order or jump around.

๐Ÿ

Python Basics

Beginner

Start from scratch. Variables, types, input, output. Run code right in your browser.

4 lessons โ†’

๐Ÿ”€

Control Flow

Beginner

If statements, loops, and the logic that makes programs think.

3 lessons โ†’

๐Ÿ“ฆ

Data Structures

Intermediate

Lists, tuples, dicts, sets โ€” the containers that hold your data.

3 lessons โ†’

โš™๏ธ

Functions & Modules

Intermediate

Package logic into reusable pieces. Import the standard library.

2 lessons โ†’

๐Ÿงฑ

Object-Oriented Python

Advanced

Classes, objects, inheritance, dunder methods, and properties.

3 lessons โ†’

โš ๏ธ

Errors & Files

Advanced

Handle exceptions gracefully and work with files.

3 lessons โ†’

โœจ

Iterators, Generators & Decorators

Advanced

Python's most powerful expressive tools.

4 lessons โ†’

๐Ÿš€

Modern Python

Advanced

Type hints, dataclasses, pattern matching, and async.

5 lessons โ†’

ฮป

Functional Python

Advanced

itertools, functools, partial application, and pure-function patterns.

3 lessons โ†’

โšก

Concurrency & Parallelism

Advanced

Threads, processes, asyncio gather, and the GIL explained.

8 lessons โ†’

๐Ÿงช

Testing & Debugging

Advanced

unittest, assertions, doctest, and disciplined debugging.

3 lessons โ†’

๐Ÿ”

Regex & Text Processing

Advanced

Pattern matching, capture groups, and parsing structured text.

3 lessons โ†’

๐ŸŒ

Data Formats & Networking

Advanced

JSON, CSV, datetime, and talking to web APIs.

4 lessons โ†’

๐Ÿง™

Metaprogramming

Advanced

Descriptors, metaclasses, and bending Python to your will.

3 lessons โ†’

๐Ÿงฐ

Collections & Stdlib Toolbox

Advanced

Counter, defaultdict, deque, namedtuple, heapq, bisect, enum.

9 lessons โ†’

๐Ÿ”ค

Advanced Typing

Advanced

Generics, TypedDict, Literal, Protocol โ€” write code your IDE understands.

6 lessons โ†’

๐Ÿ›๏ธ

Advanced OOP

Advanced

Properties, classmethods, slots, MRO, abstract base classes, walrus.

6 lessons โ†’

๐Ÿช„

Functional Extras & Context Managers

Advanced

partial, contextmanager decorator, string translation, walrus.

3 lessons โ†’

โš™๏ธ

Stdlib Power Tools

Advanced

logging, argparse, pickle, hashlib, secrets, statistics.

6 lessons โ†’

๐Ÿง 

Systems Concepts (read-only)

Advanced

Topics the in-browser sandbox can't run: multiprocessing, subprocess, sockets.

8 lessons โ†’

๐Ÿ”ฌ

Advanced Deep Dives

Advanced

Real-world advanced Python: LRU caches, retries, observers, descriptors, DI, toposort, safe eval, async queues.

9 lessons โ†’

Your first print("Hello") is one click away.

Free, in your browser, no signup required to start. Sign in only when you want to save your progress.

Start lesson 1