What a Program Actually Is

A program is a set of instructions a computer follows, in order, exactly as written. That's it. Not magic, instructions.

Every program does three things: it takes input (information going in), it processes that information, and it produces output (information coming out). A drum pattern is a program your hands run. A recipe for jollof rice is a program a cook runs. Code is a program a computer runs.

✦ Sankofa

The Sankofa bird looks backward to carry something valuable forward. That's exactly what you'll do in every lesson: look back at what you already understand, instructions, patterns, sequences, and carry it forward into code.

You're going to run real code right now. The line below tells the computer: display this text as output. Press Run Code and watch it happen.

EXAMPLE
loading editor…
YOUR TURN
Your turn → Change the message to your own name and run it again. You just wrote and edited a real program. Then delete the closing quotation mark, run it, and read what the error says.
loading editor…

Syntax has to be exact. Every quote, bracket and parenthesis needs its partner, and in Python the spaces at the start of a line count. One slip and the program won't run; the message will say where.

Notice what just happened. You gave the computer an instruction. It followed the instruction. Text appeared as output. That loop, write, run, observe, is the entire rhythm of programming, and you'll repeat it thousands of times until it feels like breathing.

✦ Syntax has to be exact

A computer never guesses what you meant. A missing quotation mark, a parenthesis or bracket that never closes, a misspelled print, or (in Python) extra spaces at the start of a line will stop the whole program with an error. That isn't the sandbox being strict: every real programming language works this way. When it happens, the message tells you which line and what went wrong. Fixing errors is a normal part of programming, not a sign you are doing it wrong.

Mark this lesson complete

Signed in, your progress follows you to every device.

Next: Input and Output →
← Back