What is a program?

A program represents information as data, and specifies a sequence of transformations to apply to it. Almost everything a program does can be described at this level: take some input, do something to it, produce some output.

A three-stage flow diagram: Input leads to Processing, which leads to Output.

  1. Input
  2. Processing
  3. Output
Every program can be described at this level, no matter the language.

"Processing" is where the interesting ideas live: choosing between options, repeating steps, breaking a big transformation into smaller ones, and keeping track of information as it changes. That is what the rest of this course teaches.

How to read the code on this site

Lessons use a few consistent block types so you always know what you're looking at:

  • A pseudocode block describes an approach in plain, language-neutral steps โ€” it is not meant to run anywhere.
  • A Python block is real, working code you could type into Python yourself.
  • An output block shows exactly what that code prints when it runs.
  • A trace table shows how variables change, line by line, as a program executes.

A tiny first example

Suppose you want to greet someone by name. In plain language: "take a name, and print a greeting that includes it."

PseudocodeThe general idea, before any particular language
get name
show "Hello, " followed by name
PythonThe same idea, written in Python
name = "Ada"
print("Hello, " + name)
Output
Hello, Ada

The practice loop

Every lesson asks you to work through the same five steps:

  1. Read the concept and the example.
  2. Predict what a piece of code will do before you're told the answer.
  3. Run it (on paper, by tracing, or for real) to check.
  4. Explain why it behaved that way, in your own words.
  5. Modify it slightly and predict again โ€” this is where understanding actually forms.

Skipping straight to "run it" is the most common way to read a lesson without learning much from it. Predicting first is what makes the difference.