Use the Python Playground — it runs Python directly in your browser with no setup needed. Come back here when you're ready to write Python on your own computer.
Windows users: don't miss the checkbox. During installation, there is a checkbox that says "Add Python to PATH". Tick it before clicking Install. If you miss it, Python will install but won't be found when you type python in the terminal — you'll need to reinstall.
Step 1 — Install Python
Python does not come pre-installed on Windows. On macOS and Linux it may be present, but often an older version. Always install the latest Python 3 from the official source.
| Operating System | How to install |
|---|---|
| Windows | Go to python.org/downloads → click "Download Python 3.x.x" → run the installer. Tick "Add Python to PATH" before clicking Install — this is the most common mistake people miss. |
| macOS | Go to python.org/downloads → download the macOS installer → run it. Alternatively, if you have Homebrew: brew install python |
| Linux (Ubuntu/Debian) | Python 3 is usually pre-installed. Check: python3 --version. To install: sudo apt install python3 |
Python 2 reached end-of-life in 2020 and is no longer maintained. Always install Python 3. If you see tutorials using print "hello" (no parentheses), they are Python 2 — ignore them.
Verify the installation by opening your terminal (Command Prompt on Windows, Terminal on macOS/Linux) and typing:
python --version
# or on macOS/Linux:
python3 --versionYou should see something like Python 3.13.0. If you do, Python is installed and ready.
VS Code is the recommendation. Install it, then install the Python extension by Microsoft from the Extensions panel (Ctrl+Shift+X or Cmd+Shift+X). This single extension gives you syntax highlighting, autocomplete, linting, and the ability to run Python files directly from the editor.
Step 2 — Choose a Code Editor
A code editor is where you write your Python files. You could use Notepad, but a proper editor helps you enormously — it highlights your code in colour, shows errors before you run, and handles indentation (which Python cares about deeply).
| Editor | Best for | Cost |
|---|---|---|
| VS Code | Everyone — the most popular choice by far. Lightweight, fast, excellent Python support via the Python extension. | Free |
| PyCharm Community | Python-specific. More powerful out of the box for Python, slightly heavier. | Free |
| Thonny | Absolute beginners. Simpler interface, built-in Python, great for learning. | Free |
| Jupyter Notebook | Data science, experimentation. Mix code and text in "cells". | Free |
Recommendation if you're just starting: Install VS Code (code.visualstudio.com), then install the Python extension by Microsoft from the Extensions panel (Ctrl+Shift+X). This gives you everything you need.
Actually do this step. Create the file. Type the code. Run it. Seeing your own code produce output is the moment learning starts. "Hello, world!" is a rite of passage that every professional programmer has done.
Step 3 — Write and Run Your First Program
Create a new file called hello.py. Type this exactly:
print("Hello, world!")
print("My name is Priya")
print("I am learning Python")Now run it. Open your terminal, navigate to the folder where you saved the file, and type:
python hello.py
# or on macOS/Linux:
python3 hello.pyYou should see:
Hello, world!
My name is Priya
I am learning Pythonprint() is Python's way of displaying output. Whatever you put inside the parentheses — in quotes — appears on the screen. That's genuinely all there is to it.
What is the REPL? REPL stands for Read-Eval-Print Loop. You type one line, Python reads it, evaluates it, prints the result, and waits. Use it for quick experiments — testing what a function does, checking what type something is, or trying an expression. It's the fastest feedback loop you have.
The Interactive Shell (REPL)
Python has an interactive mode where you type one line and immediately see the result. Just type python (or python3) in your terminal with no filename:
$ python3
Python 3.13.0 (...)
>>> print("hello")
hello
>>> 2 + 2
4
>>> name = "Priya"
>>> print("Hello", name)
Hello Priya
>>> exit() # to quitThe >>> prompt means Python is waiting for your input. This is called the REPL (Read–Eval–Print Loop). It's perfect for quick experiments — try a line of code, see what happens immediately. No file needed.
python vs python3. On macOS and Linux, python may refer to the old Python 2. Use python3 and pip3 to be safe. On Windows, python usually refers to Python 3 after a fresh install.IndentationError, check that you're not accidentally mixing spaces and tabs. VS Code handles this automatically — another reason to use a proper editor.What's next
You have Python installed, an editor ready, and you've run your first program. Now the actual learning begins. Follow the course in order — every concept builds on the previous one.