
Quick answer: Install Python 3 from python.org, tick Add Python to PATH during setup, then run python --version in a terminal. Write print("Hello, World!") in a file called hello.py and execute it with python hello.py. That is the entire loop: write, run, repeat.
Part 1 of our Python series — the full 21-part path from zero to real software engineering.
Why environment setup matters
Most people who quit Python quit on day one — not because the language is hard, but because nothing runs. A misconfigured PATH, wrong Python version, or a text editor that saves .txt instead of .py blocks every script you ever try to run. Getting this right once means every tutorial in this series works on your machine without friction.
Python is an interpreted language: there is no compile step. You write a .py file, an interpreter reads it top to bottom and executes each line. Your job in this article is to install that interpreter and prove it runs.
Step-by-step: getting Python running
1. Install Python 3
- Windows: download the latest 3.x installer from python.org. On the first screen, tick Add Python to PATH — this single checkbox is the number one setup mistake.
- macOS: install via the official installer, or
brew install python. - Linux: Python is preinstalled.
python3 --versionconfirms it.
2. Verify the install
Open a new terminal (old ones cache the PATH) and run:
python --version
# Python 3.12.x (any 3.x is fine)On Linux/macOS you may need python3 --version instead.
3. Write your first script
Create a folder python-playground, add a file hello.py:
# hello.py — my first Python script
print("Hello, World!")
print(2 + 2)4. Run it
cd python-playground
python hello.py
# Hello, World!
# 4What happened: the interpreter opened hello.py, ran each statement in order, and printed the results. # starts a comment — Python ignores everything after it on that line.
The two ways to run Python
| Mode | How to start | When to use |
|---|---|---|
| Interactive / REPL | python with no argument | Testing a line or two, quick math |
| Script mode | python filename.py | Everything real |
The REPL (>>> prompt) is a calculator with memory:
>>> 3 * 7
21
>>> exit()Complete executable example
# first-day.py — combining everything from this article
print("=== My first Python run ===")
print("Python is executing me line by line.")
result = 10 * 3
print("10 * 3 =", result)
print("Done. Next up: data types.")Common mistakes and edge cases
'python' is not recognized...— Python is not on PATH. Re-run the installer and tick Add Python to PATH, or reinstall. No PATH means no scripts, ever.- Saved as
hello.py.txt— Windows hides extensions. In your editor use Save As → Python (.py); verify withdirorls. SyntaxError: '(' was never closedor stray quotes — messages point at the line where Python got confused, which is often the line after the real error. Re-read upward.- Running the REPL by accident — if your terminal shows
>>>instead of running the file, you forgot the filename:python hello.py, not justpython. - Using Python 2 —
print "Hello"is Python 2 syntax and fails on 3.x. Any version below 3.8 is effectively retired; never install 2.x in 2026.
Key takeaways and challenge
- Python runs
.pyfiles directly; no compile step. - PATH decides whether
pythonworks from any folder. - REPL for experiments, script mode for everything else.
Challenge: write predict.py that prints three lines — your name, today’s date, and the result of 2 10 (which is 1024 — exponentiation uses ). Then run it, edit a line, and run it again. Editing and re-running is the core loop of this entire series.
Want one-to-one help getting ramped in Python? Ampersand Academy offers hands-on training.
Do I need to install Python to start coding?
Yes. Python is interpreted, so the interpreter must run your files. Download Python 3 from python.org and tick Add Python to PATH on Windows during install.
What is the difference between Python 2 and Python 3?
Python 3 is the current standard; Python 2 reached end of life in 2020. Syntax differs (print is a function in 3), and nothing new is ever released for 2. Always install 3.x.
Do I need an IDE to write Python?
No. Any text editor plus a terminal is enough. Editors like VS Code or IDLE add convenience such as syntax highlighting, but the workflow is the same: write a .py file, run it with python.
Why is python not recognized in my terminal?
Python is not on your PATH, or the terminal was opened before installation. Re-run the installer and tick Add Python to PATH, then open a brand-new terminal and test python –version again.
What should my first Python script do?
The classic first script prints Hello, World! with print(). It proves the interpreter, PATH, and file extension handling all work before you move on to variables and logic.
Last updated on · Written by Dinesh Kumar R
