Python playground

Write Python, press Run, see the result. The code runs inside your browser (Python 3.13), so there is nothing to install and your code is not sent to our server.

Editor: one file, with the result beside it. Notebook: the same file split into cells at # %% lines, each result under its code.

Output
Press Run to see the result here.
Loading...
Tips and limits
  • Ctrl+Enter (Cmd+Enter on a Mac) runs. In the notebook, Shift+Enter runs the cell and moves to the next one. Press ? for all shortcuts.
  • Only .py files run; other files, such as data.txt, can be read by your program. Files live in a small virtual disk that is cleared when you leave the page.
  • Editor: each run starts a fresh program, like typing python main.py in a terminal. Notebook: the cells share one session, so a variable made in one cell is there in the next until you restart.
  • In the notebook every cell reads the Input box from its first line. Press Stop, or run for more than 30 seconds, and Python restarts: variables from earlier cells are gone.
  • Packages that Python ships with, and common ones such as numpy, pandas and matplotlib, are downloaded when your code imports them. The first time can take a while. Charts from matplotlib appear under the cell or in the output.
  • There is no network access from your code, and threads and processes do not work.
  • Your code is saved in this browser only (autosave). A share link carries your files inside the link itself; our server never receives them. Files you open from your computer are read in the browser and never uploaded.

Keyboard shortcuts

Ctrl/Cmd + EnterRun (the notebook runs the current cell and stays there)
Shift + EnterNotebook: run the cell and move to the next one (a new cell at the end)
Double-clickNotebook: edit a text cell
Ctrl + MIn the code editor: let Tab move to the next control instead of indenting
← →On the divider: make the editor narrower or wider
?Show this list
EscClose a menu or this list