Skip to content
Exit presentation

Programming Proper I

The same program, typed instead of dragged

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.

Jump to lesson

This track

  1. 0 Start here
  2. 1 The same program, typed instead of dragged
  3. 2 A box you can change, and a box you cannot
  4. 3 Four kinds of value, and why the quotes matter
  5. 4 What the signs do, and the one that does two jobs
  6. 5 A fork in the line
  7. 6 A loop that runs until something stops it
  8. 7 Once for each thing you have
  9. 8 What the message says, and what it does not
  10. 9 The big picture
  11. 10 Track quiz

Other tracks