Skip to content
Your progress

Checking your sign-in…

Who's learning?

Each profile keeps its own read lessons, badges, streak, and practice scores on this device.

Lesson 1 of 11

The same program, typed instead of dragged

Show on a big screen

6 min

Text size

The bus board prints one stop, then the next, then the last. A typed program does the same.

Loading lab…

Three lines, waiting to run, top to bottom.
Step 1 of 4
  1. Three lines, waiting to run, top to bottom.
  2. Line 1 runs. Next stop: Canal Bridge appears.
  3. Line 2 runs. Then: Temple Street appears next.
  4. Line 3 runs. Last stop: School Gate appears last.

The rule

A typed program runs one line at a time, from the top. The lines run in the order you wrote them.

print("Next stop: Canal Bridge");

The machine is the computer that carries out your lines. One go through them is a run. A programming language is the words and rules the machine understands.

print is an instruction in that language. It writes out what is inside its round brackets. The quote marks say: write these characters as they are. The semicolon ; ends the line.

What each part of one typed line is doing
The partWhat it does
printThe instruction's name
( )Holds what it is given
"..."The characters to write out
;Marks the end of the line

Swap two lines and the board prints them in the new order. No line runs before the one above it.

Try the lab to finish this lesson.