The Station RemembersOnboard handbook

How to read a program

In your first programs, write one command on each line. Python runs them from top to bottom. The robot follows the first line, then moves on to the second.

Your first function call

go_forward()

go_forward is the name of the function that moves the robot forward. Write it in lowercase, with an underscore between the words. If you type just the name, the robot stays put.

The parentheses () call the function. Leave them empty. A step needs no extra information, so there are no arguments to put inside. The robot moves one lit tile in the direction it faces. Taking a step prints nothing.

Try it line by line

There are two lit tiles ahead on the practice track. Run the first line. Where will the robot be after the second?

  1. go_forward()
  2. go_forward()

The robot is at the start, facing right.

Which names does Python recognize?

The movement guide lists the robot’s built-in functions. The game gives you the name go_forward for moving forward. Python also reserves some words for the language itself. For example, for starts a loop.

What comes back from go_forward()?

After a successful step, the function returns None. Python uses this value when there is no result to use in a calculation. To display text, use print().

In the first lesson the marker is just one tile away. Go back to the game, write one call to go_forward() and select Run.