Notebook

noun

say it: “NOHT-book” /ˈnoʊtˌbʊk/

A file of code, results and notes kept together in blocks called cells, where each piece of code shows its answer right under it.

What is a notebook in Python?

A notebook is a file made of cells: code cells that hold Python and Markdown cells that hold notes. When a code cell runs, its result is saved right under it, so the code, the answers and the explanation stay together in one .ipynb file. VS Code opens notebooks, and a kernel runs their cells.

# one code cell in bean_street.ipynb
prices = [4.75, 3.25, 4.50]
sum(prices)        # 12.5 appears under the cell and is saved with the file

In a sentence

  • “He wrote his notes beside the code in the same notebook, so the report explained itself.”
  • “Rosa opened the notebook and saw last week's totals still printed under each cell.”

Level: Novice · More Python terms at this level

Updated