
Editing and running code
A notebook contains boxes called cells. A new notebook begins with a gray box cell, which is a text area for code editing by default. To insert and edit code:
- Click inside the gray box.
- Type in your Python code.
- Click on the >| play button or press Shift + Enter to run the current cell and move the cursor to the next cell:

Cells can be run in different orders and rerun multiple times in a session. The output and any warnings or error messages are shown in the output area of each cell under each gray textbox. The number in square brackets on the left shows the order of the cell last run:

Once a cell is run, stored namespaces, including functions and variables, are shared throughout the notebook before the kernel restarts.
You can edit the code of any cells while some cells are running. If for any reason you want to interrupt the running kernel, such as to stop a loop that prints out too many messages, you can do so by clicking on the square interrupt button in the toolbar.