Notebook Cells | Jupyter Notebook Tutorial (2026) | Step-by-Step Guide
Notebook Cells | Jupyter Notebook Tutorial (2026) | Step-by-Step Guide
Below is a step-by-step guide on Notebook Cells in Jupyter Notebook:
1. What is a Notebook Cell?
A Jupyter Notebook cell is a single block inside a notebook where you can:
- Write code
- Add explanatory text
- Display output
Each code cell can be executed independently.
2. Cell Options
A notebook cell provides the following options:
- Add a new cell above (A)
- Add a new cell below (B)
- Move the cell above (Ctrl + Shift + ↑)
- Move the cell below (Ctrl + Shift + ↓)
- Duplicate the cell
- Delete the cell (D, D)
Note: Click a cell and press Esc to enter Command Mode before using these keyboard shortcuts.
3. Cell Types
📌 Code Cell
A Code Cell is used to write and execute Python code.
- Executed using the Jupyter kernel.
- Displays the output after execution.
Example:
print("Hello World")
Run using: Shift + Enter
📌 Markdown Cell
A Markdown Cell is used for documentation and formatted text.
- Renders text into formatted content.
- Does not execute code.
- Used for notes, headings, lists, equations, and hyperlinks.
Example:
# Markdown Cell
* This is a ***markdown*** cell.
* Below is Reference Guide:
[Markdown Reference](https://commonmark.org/help/)
***
📌 Raw Cell
A Raw Cell stores plain text exactly as written.
- No code execution.
- No Markdown rendering.
Example:
This is a raw cell.
4. Switching Cell Types
To change the type of a notebook cell:
- Click the cell.
- Press Esc to enter Command Mode.
- Press one of the following shortcut keys:
- Y → Code Cell
- M → Markdown Cell
- R → Raw Cell
Alternatively, use the Cell Type dropdown menu available in the toolbar at the top of the notebook.




Comments
Post a Comment