What is Python? Setup & Your First Program
Why Python is the most in-demand language in the US job market, how it actually runs, and getting a real environment set up.
Why Python Is Worth Your Time
Python was created in 1991 by Guido van Rossum, a Dutch programmer who wanted a language that was easier to read than C and more practical than the academic languages of the time. The name has nothing to do with snakes — van Rossum was reading scripts from the British comedy group Monty Python's Flying Circus while designing it. Over three decades later, Python is the most-used language on GitHub, the top requested language on US job boards for data, backend, ML, and automation roles, and the first language taught at most American universities, including MIT's introductory computer science course. That combination — genuinely beginner-friendly, and genuinely used in production at massive scale — is rare. Most beginner-friendly languages stay beginner languages. Python did not.
Instagram serves over 2 billion users on a backend written largely in Python — and famously runs one of the largest deployments of the Django web framework in the world. Spotify uses Python extensively for backend services and its recommendation data infrastructure. Dropbox's core sync engine was originally written in Python, and Dropbox has employed Guido van Rossum himself. Netflix uses Python for internal tooling, chaos-engineering automation, and large parts of its data pipeline stack. NASA's Jet Propulsion Laboratory uses Python for mission-critical scientific computing, including software involved in Mars rover operations. This is not a beginner toy — it is a language that scales from a five-line script to systems running at global scale.
What you can actually build with it
By the end of this track you will be able to write backend services, automate real workflows, process and analyse data, build command-line tools, and understand the language deeply enough that frameworks like Django, FastAPI, and pandas stop feeling like magic and start feeling like Python you already understand, wrapped in a convenient package. Python is also the default entry point into data engineering, machine learning, and AI — every track on this site that touches data assumes this foundation, and the Python for Data Engineering lesson inside the Data Engineering track builds directly on everything you learn here.
Where Python is a poor fit
Honesty matters more than hype. Python is not the right choice for every problem, and knowing where it struggles is part of using it well. It is a poor fit for mobile app development (Swift/Kotlin dominate there), for building a low-latency game engine (C++ dominates there), and for CPU-bound number-crunching written in pure Python without specialised libraries — Python itself is meaningfully slower than compiled languages for raw computation. In practice, this last weakness is rarely a real blocker: libraries like NumPy and pandas (which you will meet later in this track) do their heavy lifting in C underneath, so Python code calling them runs at near-C speed while you write ordinary Python.
Interpreter vs Compiler — What Actually Happens When You Run Python
Languages like C and Rust are compiled: a compiler translates your entire source file into machine code — instructions the CPU can run directly — before you ever execute it. Once compiled, you distribute the resulting binary; the source code is not needed to run it. Python is interpreted: there is no separate build step where you hand your program to a compiler ahead of time. Instead, a program called the Python interpreter reads your source code and executes it as the program runs.
The standard, official Python interpreter is called CPython — written in C, and what you get when you install Python from python.org. When you run a script, CPython does not execute your raw text character by character. It first compiles your source code into an intermediate form called bytecode — a lower-level, platform- independent set of instructions, not the same as machine code — and then runs that bytecode on the Python Virtual Machine (PVM), a program that reads bytecode instructions one at a time and carries them out.
1. CPython reads script.py (your source code, plain text)
2. CPython compiles it into bytecode (an intermediate, lower-level form)
3. The bytecode is cached in a __pycache__ folder as a .pyc file
4. The Python Virtual Machine executes the bytecode, instruction by instruction
5. Your program's output appearsThis is why you will occasionally see a __pycache__ folder appear next to your scripts — that is Python caching compiled bytecode so it does not have to recompile unchanged files every time you run them. You never need to touch this folder or the .pyc files inside it, and it is standard practice to add __pycache__/ to a project's .gitignore file.
CPython is not the only implementation
"Python" is a language specification; CPython is the reference implementation almost everyone uses. Other implementations exist for specific purposes: PyPy uses just-in-time (JIT) compilation to run pure-Python code significantly faster than CPython for certain workloads; Jython runs Python on the Java Virtual Machine; IronPython targets the .NET runtime. Unless you have a specific, identified performance problem, CPython is the correct choice, and it is what this entire track assumes.
Python 2 vs Python 3 — A Brief, Important History
You will occasionally encounter references to "Python 2" in older tutorials, Stack Overflow answers, and legacy codebases. It is worth understanding why this matters. Python 2 was released in 2000. Python 3, released in 2008, intentionally broke backward compatibility to fix long-standing design flaws — most notably how it handled text versus raw bytes, a distinction that matters enormously once you work with real-world data containing non-English characters, emoji, or binary files.
The two versions coexisted for an unusually long time because migrating large codebases was expensive. Python 2 officially reached end-of-life on January 1, 2020 — it no longer receives security patches, and no serious project should be started in it. Every version of Python this track uses is Python 3. When you see python3 and pip3 used explicitly throughout this track instead of the shorter python/pip, this history is exactly why.
How Python is versioned
Python follows a major.minor.patch versioning scheme — for example, Python 3.12.4 means major version 3, minor version 12, patch 4. A new minor version ships roughly once a year, typically adding new language features (like the match/case statement added in 3.10, which you will use in the Control Flow module). Patch releases are bug fixes and security updates only. For learning and for new projects, always use the latest stable minor version available.
pyenv (macOS/Linux) exist specifically for this — they let you install multiple Python versions and switch between them per project. You will not need this on day one, but it is worth knowing the tool's name exists before you hit the problem it solves.Setting Up a Real Python Environment
Download Python from the official source: python.org/downloads. Avoid installing it from random third-party sites. On macOS and Linux, a version of Python may already be present for system use — operating system components sometimes depend on it. Do not rely on that system copy for your own projects, and never uninstall it; install your own, current version alongside it instead.
Verifying your installation
python3 --version
# Python 3.12.4
pip3 --version
# pip 24.0 from ... (python 3.12)python either does not exist or still points at the legacy Python 2. Use python3 and pip3 explicitly until you have deliberately configured your environment otherwise. On Windows, the official installer sets up python to point at Python 3 correctly — but always run python --version after installing to confirm which version you actually got, and check the box labelled "Add python.exe to PATH" during installation, or none of your commands will work from the terminal afterward.What PATH actually is, and why installers ask about it
When you type python3 in a terminal, your operating system needs to know exactly which program to run and where it lives on disk. PATH is an environment variable — a list of folder locations the operating system searches, in order, whenever you type a command name instead of a full file path. Installing Python "adds it to PATH" by placing the Python executable in one of these folders (or by adding Python's install folder to the list). If this step is skipped or fails, typing python3 produces a "command not found" error even though Python is correctly installed on the machine — the shell simply does not know where to look.
Virtual Environments — Why "Just pip install" Is a Mistake
Every Python project you build will depend on third-party packages. If you install every package globally (system-wide), you eventually run into version conflicts: Project A needs requests==2.28 and Project B needs requests==2.31, but your system only has one global copy of each package installed at a time — installing one for Project B silently breaks Project A.
A virtual environment solves this by creating an isolated, self-contained Python installation for a single project — its own interpreter and its own set of installed packages, completely separate from your system Python and from every other project's environment. This is not optional at the professional level: every real Python project you will ever work on uses one, and every job you take will assume you already know this.
# Create a virtual environment named "venv" in the current folder
python3 -m venv venv
# Activate it — macOS / Linux
source venv/bin/activate
# Activate it — Windows (Command Prompt)
venv\Scripts\activate.bat
# Activate it — Windows (PowerShell)
venv\Scripts\Activate.ps1
# Your terminal prompt now shows (venv) — you are inside the isolated environment
(venv) $ pip install requests
# Confirm you're using the environment's interpreter, not the system one
(venv) $ which python3 # macOS/Linux
(venv) $ where python # Windows
# Deactivate when you're done
(venv) $ deactivatePATH so that typing python and pip point at the copies inside venv/ instead of your system-wide installation. Nothing is copied or moved — you are just pointing your terminal session at a different, isolated interpreter until you deactivate it or close the terminal window.Every project should have its own virtual environment, created inside that project's own folder, and the venv/ folder itself should never be committed to version control — add it to .gitignore immediately. It is regenerated from a requirements.txt file, which you will build properly in the Modules & Packages lesson later in this track.
pip and PyPI — Installing Code Other People Wrote
pip ("pip installs packages", a recursive acronym) is Python's standard package manager, bundled with every modern Python installation. It downloads and installs packages from PyPI (the Python Package Index, pronounced "pie-pee-eye") — the central public repository where the Python community publishes open-source packages.
pip install requests # install the latest version of a package
pip install requests==2.31.0 # install an exact, specific version
pip install "requests>=2.28" # install a version at least this new
pip install --upgrade requests # upgrade an already-installed package
pip uninstall requests # remove a package
pip list # show everything installed in the current environment
pip show requests # show details about one installed packageWhen you install a package, pip also installs that package's own dependencies automatically — requests, for example, depends on smaller packages like urllib3 and certifi, and pip resolves and installs all of them without you needing to know they exist. This dependency resolution is also where version conflicts between packages can surface — another reason virtual environments matter so much.
pip install requests with no version installs whatever the newest release happens to be today — which could introduce a breaking change six months from now when someone else sets up the project fresh. Professional projects record exact versions (typically in requirements.txt or a modern pyproject.toml) so that every machine running the project uses identical package versions. You will build this properly in the Modules & Packages module.Writing and Running Your First Script
Create a file named hello.py — the .py extension is how Python (and your editor) identifies a file as Python source code.
print("Hello, World!")
print("Learning Python on Chaduvuko.")Run it from your terminal, in the same folder as the file:
python3 hello.py
# Output:
Hello, World!
Learning Python on Chaduvuko.print() is a built-in function that writes text to the terminal — it will be the tool you reach for constantly, both for real program output and for checking what a value actually is while you are debugging.
Script mode vs the interactive REPL
What you just did — writing code in a file and running that file — is called script mode. Python also has an interactive mode (the REPL — Read-Eval-Print Loop), which you get by typing python3 alone with no filename. It lets you type one line of Python at a time and see the result immediately — extremely useful for quickly testing a small piece of logic, but not how real programs are built or run.
$ python3
Python 3.12.4 (main, ...)
>>> print("testing something quickly")
testing something quickly
>>> 7 * 6
42
>>> exit()Comments and the shebang line
Anything after a # on a line is a comment — ignored entirely by the interpreter, meant only for humans reading the code. On macOS and Linux, scripts intended to be run directly (like ./hello.py rather than python3 hello.py) conventionally start with a shebang line:
#!/usr/bin/env python3
print("Hello, World!")This tells the operating system which interpreter to use when the file itself is executed as a program (after marking it executable with chmod +x hello.py). You will not need this for most of this track, where you will run scripts explicitly with python3 filename.py, but you will see it at the top of real-world Python scripts constantly.
Editors, IDEs, and Notebooks — What Professionals Actually Use
Visual Studio Code (free) with the official Python extension is the standard choice for most developers and what this track assumes you are using. It gives you syntax highlighting, autocomplete, inline error detection, and an integrated debugger with no paid upgrade required.
The alternatives, and when they make sense
PyCharm (JetBrains) is a full IDE built specifically for Python, with deeper built-in refactoring tools and project management features than VS Code's general-purpose extension model provides. It has a genuinely useful free Community edition. It is a strong choice once you are working on larger, multi-file projects, but has a steeper learning curve for a first setup than most beginners need.
Jupyter Notebooks run Python in cells you execute individually and see output from immediately, interleaved with formatted text and charts — the standard tool for data science and exploratory analysis, and something you will use extensively once you reach the Data Science and Machine Learning tracks on this site. Notebooks are excellent for exploring data and prototyping quickly, but are a poor fit for building reusable, tested, production software — real applications are built as plain .py files, which is the skill this track focuses on first.
hello.py file you just created, run it with the green "Run" arrow in the top-right corner (or the keyboard shortcut it shows), and confirm the output appears in the integrated terminal panel at the bottom. This is the workflow you will use for the rest of this track.Day One at a Denver Startup — Setting Up to Actually Ship Code
You join a small e-commerce company as a junior backend developer. Your onboarding document says: "Clone the repo, set up your environment, and open a small pull request fixing the bug in issue #482 by end of week." Nobody sits with you to explain each step — this is assumed knowledge.
What actually happens
You clone the repository and find a requirements.txt file with 34 packages listed, pinned to exact versions. You create a virtual environment (python3 -m venv venv), activate it, and run pip install -r requirements.txt — installing all 34 dependencies at the exact versions the rest of the team is using, not whatever happens to be newest today. You confirm your Python version matches what the project expects by checking a .python-version file in the repo root, which tells you the team is on Python 3.12.
Why every step from this module mattered
If you had skipped the virtual environment and installed packages globally, you would have silently broken compatibility with a different project already on your machine using a different version of the same library. If you had not verified your Python version matched the project's, you might have hit a syntax error from a language feature the project uses that your older Python does not support — a confusing failure that looks like a bug in the code itself. If you had not understood PATH, a "command not found" error on your very first command would have looked like a broken installation rather than a five-second fix.
None of this is advanced. All of it is assumed. This is exactly why this module exists before any real Python syntax — the setup fundamentals are the difference between spending your first day writing code and spending your first day stuck on tooling.
Four Misconceptions That Slow Beginners Down
5 Interview Questions — With Complete Answers
Setup Mistakes That Cost Beginners Hours
Errors You Will Hit While Setting Up — And Exactly Why
🎯 Key Takeaways
- ✓Python is interpreted, not compiled — CPython compiles your source to bytecode and runs it on the Python Virtual Machine, with no separate ahead-of-time build step.
- ✓Always use Python 3. Python 2 reached end-of-life in January 2020 and has no security support — never start new work in it.
- ✓Install Python from the official python.org source. Use python3/pip3 explicitly on macOS and Linux to avoid ambiguity with legacy Python 2.
- ✓PATH is the list of folders your OS searches for a command by name. A skipped "Add to PATH" step during install is the #1 cause of "command not found" errors.
- ✓A virtual environment is a self-contained, isolated Python installation per project. Every real project uses one — this is not optional at the professional level.
- ✓pip installs packages from PyPI. Pin exact versions for real projects — "just install whatever is newest" silently breaks reproducibility.
- ✓Never commit a venv/ folder to Git. It is regenerated from requirements.txt on any machine.
- ✓.py is the file extension for Python source code. Script mode (running a file) is how real programs run; the interactive REPL is for quick, disposable testing.
- ✓print() writes to the terminal and will be your most-used debugging tool for the rest of this track.
What comes next
Module 02 covers variables and every core data type in Python — how dynamic typing actually works, and how to convert between types without introducing silent bugs.
Module 02 → Variables, Data Types & Type ConversionDiscussion
0Have a better approach? Found something outdated? Share it — your knowledge helps everyone learning here.