First Steps
First Steps
Tier 0 of the Python book, for readers with zero programming background. Five chapters take you from "what is a program?" to a working interactive script — values, numbers, text, and input/output — with every example runnable in the browser.
Suggest an editFirst Steps
This is Tier 0 — the beginning. It assumes you have never programmed before, in any language. By the end of these five chapters you'll have written and run real Python: doing arithmetic, building text, reading input from a person, and printing answers back.
Five chapters, in order:
- What Python Is & Running Code — what a program is, what the Python interpreter does, and
print— the command that lets a program talk back. - Variables & Basic Types — naming values so you can reuse them, and the four basic kinds of value: whole numbers, decimals, text, and true/false.
- Numbers & Arithmetic — the maths operators, the two kinds of division, and why
0.1 + 0.2isn't quite0.3. - Strings, the Basics — building and reshaping text with f-strings and methods, and reading individual characters.
- Input & Output — reading what a person types, converting it to a number, and writing a first interactive program.
Every code block with a ▶ Run button is live — click it, change the code, run it again. The fastest way to learn at this tier is to perturb working examples: change a number, swap a word, break something on purpose, and see what happens. You cannot harm anything; the worst case is an error message, and reading error messages is itself a skill these chapters build.
📘 How to read the Intuition boxes. Each one is built in three moves:
- The mechanism — what the interpreter is actually doing.
- A concrete bite — a specific, runnable way the naive assumption fails.
- The earned rule — the decision heuristic, now justified rather than asserted, plus its cost.