Jupyter Notebook is one of the best tools for learning Python, math, and data science because it lets you write code, run it instantly, and add notes or explanations — all in one place. Here’s a step-by-step guide to get you started:
You need Python installed first.
Here are two common ways to install Jupyter:
Go to https://www.anaconda.com/download
Download Anaconda Distribution (choose your OS).
Install it (just follow the setup wizard).
Open Anaconda Navigator and click Launch Jupyter Notebook.
Recommended if you’re new — it comes with Python, Jupyter, and lots of libraries pre-installed (numpy, pandas, matplotlib).
If you already have Python installed:
pip install notebook
Then launch Jupyter:
jupyter notebook
Once launched, Jupyter will open in your browser at a URL like:
http://localhost:8888/tree
You’ll see a file browser where you can:
Navigate to a folder
Click New > Python 3 Notebook to create a new notebook.
A notebook has cells — two main types:
Code cells (default) → where you write Python code
Markdown cells → where you write text, formulas, notes
You can switch cell type from the toolbar.
Write Python code in a cell and press:
Shift + Enter → Run cell and go to next one
Ctrl + Enter → Run cell and stay in the same one
Example:
x = 5
y = 10
x + y
Press Shift+Enter → It will output 15.
Click a cell, change it to Markdown, and type:
# This is a Heading
**Bold Text**
*Italic Text*
- Bullet point 1
- Bullet point 2
`inline code`
Then press Shift+Enter to render it.
You can plot directly in Jupyter:
import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5]
y = [n**2 for n in x]
plt.plot(x, y)
plt.title("Square Numbers")
plt.show()
A → insert cell above
B → insert cell below
D + D → delete cell
M → convert to Markdown
Y → convert to Code
Shift + Enter → run cell
You can press H to see all keyboard shortcuts.
Google Colab (short for Collaboratory) is a free, cloud-based Jupyter Notebook environment that runs entirely in your browser.
It lets you:
Write and run Python code
Use free GPU/TPU computing power
Share notebooks easily (like Google Docs)
Install and use Python libraries on the fly
It’s widely used for:
Learning Python
Machine learning projects
Data analysis
Collaborative coding
No installation required – works in your browser.
Free GPU/TPU access – good for machine learning or heavy computation.
Auto-saves to Google Drive – your work is backed up.
Easy sharing – like sharing a Google Doc.
Pre-installed libraries – numpy, pandas, matplotlib, tensorflow, etc.
Works on any device – Windows, Mac, Linux, Chromebook.
Go to: https://colab.research.google.com
Use your Google account (your work will be saved to Google Drive).
Click File > New Notebook to create a fresh notebook.
You will see a familiar notebook interface with code cells.
Type Python code into a cell and press Shift+Enter to run it.
Example:
x = 10
y = 20
x + y
This will output 30 below the cell.
You can add text and notes using Markdown cells.
Example:
# Heading
**Bold** and *italic* text
You can install libraries with pip commands inside a cell:
!pip install numpy
import numpy as np
arr = np.array([1, 2, 3])
print(arr * 2)
To enable GPU or TPU:
Go to Runtime > Change runtime type
Select GPU or TPU under "Hardware accelerator"
Save and rerun your code
Click Share in the top right, choose view/comment/edit permissions, and share the link with collaborators.
You can plot directly in Colab:
import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5]
y = [n**2 for n in x]
plt.plot(x, y, marker='o')
plt.title("Square Numbers")
plt.xlabel("x")
plt.ylabel("x squared")
plt.show()
Sessions end after 12 hours (or sooner if idle).
Files are temporary unless saved to Google Drive.
Free GPUs are shared resources and may not always be available.