Kernel

noun

say it: “KER-nul” /ˈkɝnəl/

In a notebook, the running Python program that carries out the cells' code and remembers every variable they create.

What is a notebook's kernel?

A notebook's kernel is the running Python program that runs its cells. It remembers every name the cells make, in the order the cells ran, not the order they sit on the page. Restarting the kernel empties that memory.

# cell 1
tax_rate = 0.08
# cell 2: works, because the kernel still remembers tax_rate from cell 1
round(49.25 * (1 + tax_rate), 2)    # 53.19

In a sentence

  • “He restarted the kernel to clear out every old variable.”
  • “The kernel still remembered the total from a cell she had deleted.”

Level: Apprentice · More Python terms at this level

Updated

In other subjects