Playground

A place to try things out. Real Python runs on your own machine, inside the browser, with nothing to install. JavaScript, TypeScript and a practice shell are here too. Pick an example below or write your own. Files you create live on a private virtual disk that resets when you reload.

# Everything here runs on real CPython, inside your browser.
import sys
print("Hello from Python", sys.version.split()[0])

for i in range(1, 6):
    print("*" * i)
 
Python (loads on first run)Ctrl+Enter runs
Output
Press Run (or Ctrl+Enter) to execute this code in your browser.

What works

  • The full standard library: math, random, json, re, datetime, csv, dataclasses, itertools, asyncio, sqlite3, pathlib, and more.
  • input() — open Program input and type the answers ahead of time, one per line.
  • Files: open(), pathlib and os all write to a private in-memory disk.
  • numpy, pandas, scipy, sympy, matplotlib (data only), pillow, sqlalchemy, pydantic and other pure-Python packages, fetched on first import.
  • Top-level await, and asyncio.run() is translated for you.
  • TypeScript is compiled with the real compiler (types erased), JavaScript runs in a worker, and the Shell tab is a simulated bash with pipes, redirection and a small file system.

What does not

  • Network sockets, requests to other sites, subprocess, and threads that block.
  • Desktop windows (tkinter), web servers (FastAPI, Flask) — those lessons say so and are marked to run locally.
  • Very heavy computation: your laptop is doing the work, and a single tab gets one core.

Want Python on your own computer? The Python course shows how to install it.