Previous page

BEFORE PYTHON

Your brain makes tiny plans.

A plan is a few steps in an order that works.

YOU ALREADY KNOW THIS

Your brain plans all day.

When you get ready, play, or make something, your brain quietly chooses what happens first, next, and last.

Coding uses that same skill. You do not have to know everything at once.

YOUR TURN

Find the missing step.

A step is missing. It can be first, in the middle or last. Pick it, and PyBot will check it.

0 Completed
13 Not tried
0 Review

Get a glass of water

  1. 1

    Take a glass.

  2. 2

    Put it under the tap.

  3. 3

    ?

  4. 4

    Turn off the tap.

Which step is missing?

Pack your school bag

  1. 1

    ?

  2. 2

    Add your notebooks.

  3. 3

    Add your pencil case.

  4. 4

    Close the bag.

Which step is missing?

Wash your hands

  1. 1

    Wet your hands.

  2. 2

    ?

  3. 3

    Scrub and rinse.

  4. 4

    Turn off the tap.

Which step is missing?

Brush your teeth

  1. 1

    Put toothpaste on the brush.

  2. 2

    Brush your teeth.

  3. 3

    Rinse the toothbrush.

  4. 4

    ?

Which step is missing?

Get dressed

  1. 1

    Put on your shirt.

  2. 2

    Put on your pants.

  3. 3

    ?

  4. 4

    Put on your shoes.

Which step is missing?

Make a bowl of cereal

  1. 1

    Get a bowl.

  2. 2

    ?

  3. 3

    Add milk.

  4. 4

    Get a spoon.

Which step is missing?

Draw a picture

  1. 1

    ?

  2. 2

    Choose your crayons.

  3. 3

    Draw your picture.

  4. 4

    Put the crayons away.

Which step is missing?

Get ready for bed

  1. 1

    Put on your pajamas.

  2. 2

    Brush your teeth.

  3. 3

    Get into bed.

  4. 4

    ?

Which step is missing?

Read a book

  1. 1

    Choose a book.

  2. 2

    Sit somewhere comfortable.

  3. 3

    ?

  4. 4

    Start reading.

Which step is missing?

Take a photo

  1. 1

    Open the camera.

  2. 2

    ?

  3. 3

    Hold the device still.

  4. 4

    Tap the photo button.

Which step is missing?

NEW CHALLENGE

Put the steps in order.

The steps got mixed up. Drag them up or down, then check your plan.

Drag a step, or select it and use the up and down arrow keys.

Plant a seed

Drag the steps into the right order.

  1. 1

    Cover it with soil.

  2. 2

    Dig a small hole.

  3. 3

    Water it.

  4. 4

    Drop the seed in.

Make a sandwich

Drag the steps into the right order.

  1. 1

    Put the other slice on top.

  2. 2

    Spread butter on one slice.

  3. 3

    Take two slices of bread.

  4. 4

    Add the cheese.

Wrap a gift

Drag the steps into the right order.

  1. 1

    Wrap the box in paper.

  2. 2

    Stick a bow on top.

  3. 3

    Put the gift in a box.

  4. 4

    Hold the paper with tape.

  5. 5

    Close the box.

Your plans are saved here.

Want a fresh start? Clear only this page.

A NEW WORD

Your plans have a name: algorithms.

An algorithm is a list of clear steps, in order, that solves a problem. Every plan you just finished is an algorithm!

ALGORITHMS IN CODE

Code is an algorithm for a computer.

When you write code, you write the steps. The computer reads them one at a time, from top to bottom, and does exactly what each line says.

The computer never guesses. If a step is missing or in the wrong place, it will not fix it for you.
PyBot fills a glass of water

Goal: a full glass, and not one drop of water wasted.

  1. take a glass
  2. put the glass under the tap
  3. open the tap
  4. wait until the glass is full
  5. close the tap

Swap lines 2 and 3: the tap opens before the glass is under it, and the water runs down the drain. Wasted!

Swap lines 4 and 5: the tap closes first, the glass never fills, and PyBot waits forever!

BIG IDEA

Order helps a plan work.

Clear steps in order make an algorithm. Computers follow algorithms one step at a time.