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.
Input for input() (one line for each call)
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
.pyfiles run; other files, such asdata.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.pyin 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.