What Is Programming, Really?
A computer does exactly, and only, what you tell it to do — nothing more, nothing implied, nothing assumed. Programming is the skill of giving instructions precise enough that a machine with zero judgment of its own can follow them correctly.
Code is just instructions, run in order
At its core, a Python program is a list of instructions, executed one after another, top to bottom, unless something tells it to do otherwise (you'll learn exactly how to change that order in Week 2). Consider:
print("Starting calculation...")
total = 5 + 3
print(total)
print("Done.")
Run this and Python does exactly four things, in exact order: print a message, compute 5 + 3 and store it, print that stored value, print a final message. Nothing clever is happening — that literal, mechanical predictability is the entire foundation of programming.
Try it below — it's already filled in, just press Run:
Now change the 5 + 3 to something else, or add a third print(...) line of your own, and run it again. Nothing here is graded — this is purely to build the habit of "change something, run it, see what actually happened," which is genuinely most of what real programming looks like day to day.
The interpreter: how your code actually runs
Python is an interpreted language — when you run a Python file, a program called the Python interpreter reads your code line by line and executes it immediately, translating your human-readable instructions into something the computer's processor can actually act on. This is different from languages like C, which must be fully "compiled" into machine code before they run at all. Interpretation is a big part of why Python feels so immediate: you write a line, run it, and see the result right away.
Syntax: the rules that make code valid
Just like English has grammar rules, Python has syntax — precise rules about how code must be written for the interpreter to understand it. Where humans can parse "he go to store" despite the grammar mistake, Python cannot forgive an equivalent error. Miss a colon, misplace a quotation mark, or indent something incorrectly, and Python will refuse to run the code at all and instead show you an error.
This is not the computer being difficult — it's the entire point. Precision is what makes programming powerful: once you say exactly what you mean, the computer will do exactly that, every single time, without getting tired or making a careless mistake, at a speed and scale no human could match.
Two genuinely different kinds of errors
Beginners often lump every error together as "it's broken," but Python actually distinguishes two real, different categories, and telling them apart quickly is a genuinely useful skill:
Syntax errors — the code isn't even valid Python, so nothing runs at all, not even the first line:
print("Hello"
SyntaxError: '(' was never closed
Runtime errors — the code IS valid Python, and starts running, but something goes wrong partway through, once real values are involved:
age = "twenty"
print(age + 1)
TypeError: can only concatenate str (not "int") to str
Notice the difference: the second example is perfectly valid syntax — Python has no complaint about the shape of the code — the problem only appears once Python actually tries to add a number to a piece of text, which is genuinely meaningless. This distinction matters practically: a SyntaxError means "fix the structure before anything can run at all"; a runtime error like TypeError or NameError means "the structure is fine, but check what value actually ended up in a variable." You'll get real, repeated practice telling these apart throughout this entire program.
Reading error messages instead of fearing them
Every programmer, no matter how experienced, spends a large share of their time looking at error messages — they are not a sign you've failed, they are Python telling you specifically what's wrong. That message above is Python being genuinely helpful: it's telling you exactly what's structurally wrong (a missing closing parenthesis) and roughly where. Learning to actually read these messages — not just panic and delete everything — is one of the highest-leverage skills in this entire program.
This week's practical exercise
Copy the four-line example from the top of this lesson into a notes app or text file (or just use the runnable box above), and trace through it line by line, predicting exactly what each print(...) will show before checking. Then deliberately write age = "twenty" followed by print(age + 1) in the runnable box above, run it, and read the real TypeError Python gives you — matching the runtime-error example above, but seeing it happen for real.
Further reading
- Python's official "Using Python as a Calculator" tutorial — the same official documentation real Python developers reference
- Python's built-in exception types — the real, complete list of error types you'll gradually get familiar with across this program