In [ ]
Playground
Instructions Show Hide
Try some simple Python programming exercises in the Playground! Familiarize yourself with the features below before you begin!
Button guide
Notebook files
- Open
- Open a local
.ipynbnotebook. - New
- Start an empty notebook after confirmation; attached files remain.
- Save
- Download the current cells and outputs as
.ipynb. Attached data files are not embedded.
Attached files
- Add files
- Choose files, then a folder under
/home/pyodide(default:Path("uploads")). For example,data/trainsaves to/home/pyodide/data/train, even afteros.chdir(). The same full path replaces a file; different folders keep separate copies. - Remove
- Remove the selected attached file.
- Clear all
- Remove every attached file while keeping notebook cells.
Notebook controls
- Add cell
- Add an empty Python cell at the end.
- Run all
- Run or render every cell from top to bottom.
- Restart
- Reset Python while keeping cells, attached files, and cached packages.
Reference tools
- Available packages
- Browse packages available in the browser runtime.
- Markdown rules
- Open Markdown syntax examples and renderer limitations.
- Show shortcuts
- Open the editor keyboard shortcut reference.
- AI assistance
- Select Markdown text and press Alt + A for a revision, or place the caret on a completed Python line and press Alt + A for the next-code proposal.
Cell type and execution
- Python
- Set the selected cell to executable Python.
- Markdown
- Set the selected cell to Markdown.
- Run
- Run the selected Python cell.
- Render
- Render the selected Markdown cell.
- Edit
- Reopen rendered Markdown for editing.
- Stop
- Stop the active Python cell and restart Python state. Cells and attached files remain available.
- Copy
- Copy a code block shown in rendered Markdown.
Cell organization
- Add above
- Insert a cell above the selected cell.
- Add below
- Insert a cell below the selected cell.
- Merge above
- Merge the selected cell with the same-type cell above it.
- Merge below
- Merge the selected cell with the same-type cell below it.
- Delete
- Delete the selected cell; press
Zto restore the latest deleted cell.
Notebook controls Show Hide
New notebook (unsaved)
No local files selected.
Python 3.12 (Pyodide)
Python 3.12
Preparing Python in this browser…
Open this list to load the package catalog.
Write Markdown, then select Render or move to another cell. Double-click rendered Markdown to edit it again.
- # HeadingUse one to six # characters for heading levels 1–6.
- **bold**Bold text.
- *italic*Italic text.
- ~~strike~~Strikethrough text.
- `code`Inline code.
- ---Horizontal rule.
- - itemBulleted list; indent nested items with spaces.
- 1. itemNumbered list.
- - [x] taskDisplay-only task list.
- > quoteBlock quote.
- [label](https://...)Link; use a complete HTTPS URL when possible.
- Image with alternative text.
- Table| Name | Score | · | --- | ---: | · | Kim | 95 |
- Fenced code```python · print("Hello") · ```
- SupportedGitHub Flavored Markdown tables, task lists, and automatic links.
- SafetyUnsafe HTML, scripts, and event handlers are removed.
- LaTeXUse $...$ or \(...\) for inline math and $$...$$ or \[...\] for block math. Math inside inline code and fenced code remains code. Mermaid fences are shown as code.
- URLsUse absolute URLs; relative links resolve against this website.
These shortcuts and scrolling gestures work while editing a Python or Markdown cell.
- Enter · PythonContinue the current indentation; add four spaces after a block-opening colon or opening bracket.
- Ctrl + EnterRun or render the current cell.
- Shift + EnterRun or render, then edit the next cell.
- Ctrl/Cmd + SDownload the Notebook outside fullscreen. In fullscreen, use the Save button.
- Ctrl + SpaceEnter or exit fullscreen on desktop, including while editing. When fullscreen is unavailable, show Python code completions. Completions also appear while typing, including imports written earlier in the cell before execution; use Tab or Enter to accept and Esc to close.
- Ctrl + Shift + SpaceShow the active Python argument, its description, the function signature, and a short function summary.
- Alt + A · MarkdownSelect text in a Markdown cell to request a context-aware revision.
- Alt + A · PythonPlace the caret on a completed Python line to request the AI next-code proposal.
- TabAccept a visible completion or AI proposal; otherwise indent the selected lines by four spaces.
- Alt + Q / EscDismiss the visible AI proposal.
- Shift + TabDecrease indentation on the selected lines.
- Ctrl + /Toggle comments on the selected lines.
- Shift + WheelScroll a horizontally overflowing code block left or right.