Lesson 3 of 18 · 2 min
Installing Python — Setting Up Your Workspace
The WHY — Why Install Python?
Python is a program that reads your code and executes it. Your computer does not come with Python pre-installed (or has an old version). You need the latest version to use all modern features.
Step-by-Step Installation
Step 1: Go to https://python.org/downloads in your browser
Step 2: Click the big "Download Python 3.x" button
Step 3 (WINDOWS ONLY — CRITICAL): During installation, you will see a screen with checkboxes. CHECK the box that says "Add Python to PATH" before clicking Install. If you miss this, Python will not work from the command line and you will need to reinstall.
Step 4: Click "Install Now"
Verifying Your Installation
Open your terminal (Command Prompt on Windows, Terminal on Mac/Linux) and type:
python --version
Output: Python 3.12.0
If you see a version number — success! If you see an error, try python3 --version instead.
Three Ways to Run Python Code
Method 1: Interactive Shell — The "Pocket Calculator" Mode
Type python in your terminal. You get a >>> prompt:
>>> 2 + 2 # type this, press Enter
4 # Python instantly shows the answer
>>> print("Hello") # type this, press Enter
Hello # Python displays Hello on screenExit with exit() or press Ctrl+D (Mac/Linux) or Ctrl+Z then Enter (Windows).
Method 2: Running a .py File — The "Real Program" Mode
Write code in a file ending in .py. Save it. Run with:
python my_program.py
Method 3: Jupyter Notebook — The "Data Scientist" Mode
pip install jupyter # install jupyter (run this once) jupyter notebook # launch jupyter in your browser
Jupyter opens in your browser. You write code in "cells" and run them one at a time with Ctrl+Enter. This is the best mode for data analysis because you see results immediately without running the whole program.
