liveBook · Manning

Cell

As explained in The Quick Python Book, Fourth Edition

A notebook cell is a discrete unit in an interactive notebook containing executable code or formatted text.

A notebook cell is a discrete unit for either formatted text or executable code. Text cells use Markdown; code cells contain Python and display execution output below. section 2.3 section 2.6

Use the two cell types differently:

  • Edit a text cell, then save or select it to return to formatted display. section 2.3
  • Run a code cell with Ctrl-Enter, its run control, or the context menu; output appears immediately below. section 2.3
  • Inspect errors beneath the code cell, including the reported line, caret location, and Python error message. section 2.3.2

A code cell and its output

Enter print("Hello, World") in a code cell and run it. The output Hello, World appears below the cell, separate from the entered code. section 2.3.1

print("Hello, World")                           #1
      
Hello, World                                    #2
#1 Code entered in code cell
#2 Output from running code, below code cell

Browse the compact listing showing code entered in a cell and the output produced beneath it. section 2.3.1

How The Quick Python Book, Fourth Edition covers it

How deep it goes
Distinguishes text and code cells, explains editing, execution, output, and errors, but stops short of notebook internals.
Examples
Uses a Hello World code cell and a deliberately missing parenthesis to demonstrate output and syntax errors.
What it assumes
Assumes general programming familiarity while introducing notebook cells, Markdown formatting, execution controls, and output placement.
What you can do after
Operate cells to write Markdown, run Python, read output, and inspect reported errors.
How it connects
Connects Jupyter notebooks with Markdown, Python, code execution, output, and error messages.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Quick Python Book, Fourth Edition. The section links point to the parts of the book it draws on.