A List of Instructions the Machine Obeys
A program is an ordered list of statements the computer carries out exactly, one after another from top to bottom. · 9 min
A program is a list of instructions you write for a computer. The computer does not read ahead, guess your intent, or fix your order. It starts at the first line, finishes it, moves to the next, and keeps going straight down to the last line. That plainness is the point: because the order is fixed, you can know exactly what a program will do before you run it — by reading it the same way the computer does, one line at a time.
Guess before you learn
This program has three lines:
print("Good morning.")
print("The time is 9.")
print("Have a good day.")
Which line of text appears first on the screen?
The computer runs the top line first, so Good morning. appears, then the second line, then the third. If you guessed they appear at once, keep that pencil mark: output feels instant, but the lines really do run one after another, in order — which is exactly what this folio is about.
9–12
3–5
A program is a list of instructions written for a computer. It reads them in order, from the first line to the last. Each line is one small job: show a word, add two numbers, remember a value. One line alone does very little. Put the right lines in the right order and together they do something useful. Swap two lines and the program may do something completely different — the computer will not rearrange them to make sense. It trusts your order exactly.
6–8
Each line of a program is a statement — one complete instruction. Python executes them in sequence: it runs the first statement, finishes it, then moves to the next, straight down the file. This default order is called sequential execution. Nothing runs early, nothing runs twice, and nothing is skipped — unless a later tool tells it to. Because the order is fixed, you can predict exactly what a program does by reading it from top to bottom, one line at a time. That reading is precisely what tracing means, and it is the single most useful habit in this whole course.
9–12
A program is an ordered sequence of statements, and the interpreter executes them one at a time in the order they are written, top to bottom. This is the sequential model of execution: after a statement finishes, control passes to the next line, and only to the next line. The three big ideas ahead — decisions, loops, and functions — are all just disciplined ways to change which statement runs next. Until you meet them, every program you read runs in a single straight line, which means reading a program and running a program are the same act performed at different speeds.
K–2
A program is a list of steps. The computer starts at the top. It does the first step, then the next, then the next, all the way down. It never skips. It does just what the list says.
Change the order and the result changes. If you take the toast out before you wait, the bread is still cold. The computer will not fix the order. It follows your list exactly.
Undergrad
Formally, a program's source is a list of statements; running it means an interpreter maintains an implicit instruction pointer that advances through them in order. Sequential composition is the default control flow — s1; s2 means do s1, then do s2 — and everything else (branching, iteration, calls) is defined as a controlled departure from that default. The value of the sequential model is determinism: given the same starting conditions, the same statements in the same order produce the same result every time. That reproducibility is what makes a program something you can reason about rather than merely observe running.
Postgrad
In an operational semantics, execution is a relation on configurations — pairs of a remaining statement list and a state — where each step consumes the head statement and updates the state. Sequential execution is the transitive closure of that single-step relation over a straight list. The von Neumann model that real hardware implements is the same idea with a program counter incremented after each instruction. Control structures are, at this level, nothing but syntax for altering that counter; the primitive underneath every program you will ever write is next statement, then the next.
statement
One complete instruction, usually on its own line. A program is a list of statements the computer runs in order.
Because the order is fixed, you can trace a program: read it line by line and write down what each line does. Tracing is how you predict output without running anything, and how you find the exact line where a program goes wrong. One more quiet fact: running the same program again, unchanged, gives the same result. A program is repeatable, not random.
Why is this true?
Why can you predict a program's output just by reading it from top to bottom?
Because statements run in a fixed order — each one finishes before the next begins, and none is skipped. Reading in that same order walks the exact path the computer takes, so the output is knowable in advance.
Trace this program line by line — the steps fade as you master them
print("Loading"). What appears on the screen?Loading
print(3 + 4). Python computes 3 + 4, then shows the result. What appears?7
print("Done"). What appears?Done
Note
Losing track of what runs first? The Atelier of Mind teaches tracing drills that make reading code in order automatic.
Practice — new ink and old, interleaved
1.Which statement is true of every program you have seen so far?
2.What number does print(6 + 6) show?
3.Put these lines in the order they run.
- print("one")
- print("two")
- print("three")
4.Say in your own words what a program is.
A program is an ordered list of statements a computer carries out exactly, one after another from top to bottom.
How close were you? Grade yourself honestly — it sets your review date.