The Notebook app is a cell notebook on Pyodide (Python in WebAssembly). When the status line is ready, you can run code.
Know Shift+Enter, + Code, Import .ipynb, Reset, and files before a NameError or a missing upload surprises you.
Run a cell
Click + Code, paste, then Shift+Enter (or the cell’s Run button). Shift+Enter also moves to the next cell.
print("Hello from the notebook")
import sys
print(sys.version)You should see a greeting and a Python version. The last expression of a cell is also displayed:
2 + 2That prints 4 without print. An assignment does not display:
n = 2 + 2
nPut n on its own last line, or print(n).
Markdown vs code
+ Markdown is for notes. Shift+Enter previews it; it does not run Python. Double-click a preview to edit.
Run all, Reset, drafts
- Run all executes every code cell top to bottom. Names persist across cells until you reload.
- Code autosaves in this browser.
- Reset restores the starter notebook. Confirm the dialog. Uploaded files usually stay.
- Returning visitors may see an old draft. Reset if the starter cells are gone.
Import and export .ipynb
Each chapter (except Overview) has This chapter .ipynb on the banner. Download it, then Import .ipynb in the notebook. Download As… exports your current notebook.
Files
Click Add files (or drop a file on the notebook) for data. Then:
import os
print(os.listdir("/uploads"))Readable as notes.txt or /uploads/notes.txt. Writes under /uploads/ become download chips.
Open a .py file with Open file to insert it as a code cell. Add files is for data.
Privacy
Python runs in this tab. Drafts live in localStorage; uploads live in IndexedDB. Lesson pages never see your cells.
There is no input(). Do not paste examples that wait for keyboard input — the cell will hang.