Cells, Kernels, and Run Order
How a Jupyter notebook actually executes.
Cells, Kernels, and Run Order is a free Data Science Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Data Science Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
A Notebook Is a Stack of Cells
A Jupyter notebook is built from cells, small editable boxes you fill and run one at a time. This is what makes analysis feel interactive.
Run One, See the Result
Type code in a cell, then press Shift+Enter to run it. The output appears right below, so you never lose sight of what happened.
2 + 3 * 4The Kernel Does the Work
Behind your notebook runs a kernel, a live Python process that executes each cell and remembers everything between them.
State Carries Over
Because the kernel stays alive, a variable set in one cell is still there in the next. Run this, then use total later.
total = 100Use It Anywhere Below
In a fresh cell you can reuse total without redefining it. The kernel kept it in memory for you, ready to build on.
total * 2Order of Execution Matters
Cells run in the order you press run, not top to bottom. That run order is the single biggest source of confusing notebook bugs.
Read the Run Counter
The number in [ ] beside a cell shows when it last ran. Tracking that execution count tells you the true order things happened.
Out-of-Order Surprises
If you edit an early cell but skip rerunning it, later cells use stale values. Your run order no longer matches the code you see.
Restart to Get Clean
When state feels tangled, use Restart Kernel. It wipes all variables so you start from a blank, trustworthy slate.
Run All in Order
After restarting, choose Run All to execute every cell top to bottom. This proves your notebook works as a clean, repeatable story.
Edit Mode vs Command Mode
Green means you are typing inside a cell; blue means you are commanding the notebook. Esc and Enter flip between the two.
Quick Check
Your notebook gives odd results and you suspect cells ran out of order.
Recap: Cells and Kernel
You learned that cells run on a stateful kernel, that run order can fool you, and that Restart plus Run All keeps a notebook honest. 👍
Frequently asked questions
Is the “Cells, Kernels, and Run Order” lesson free?
Yes — the full text of “Cells, Kernels, and Run Order” is free to read here on the web, and the Data Science Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Data Science Academy course, upgrade to CoddyKit PRO.
What will I learn in “Cells, Kernels, and Run Order”?
How a Jupyter notebook actually executes. You practise Data Science Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Data Science Academy?
No prior experience is required. Data Science Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Cells, Kernels, and Run Order” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Data Science Academy lesson?
Yes. Every Data Science Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Install Python the Painless Way
- Cells, Kernels, and Run Order
- Markdown Notes Beside Your Code
- Import, Inspect, Repeat