First, Then, Next: Your First Coding Sequence
When you make a peanut butter sandwich, you get the bread first, then spread the peanut butter, then put the slices together. If you did it in the wrong order โ like spreading peanut butter before you even have bread out โ it would be a mess! Computers need the same kind of first-then-next list. We call that list a sequence.
What You'll Learn
What a sequence is Why the order of steps matters How to give directions using first, then, next, and last How to find and fix a step that is out of order
What Is a Sequence?
A sequence is a list of steps that a computer, a robot, or even you follow in order, one at a time, from top to bottom. Skip a step or do it out of order, and things go wrong โ just like the sandwich!
Try It: Robot Directions
Imagine giving a toy robot directions to grab a cup: Step 1, walk forward 3 steps. Step 2, turn right. Step 3, walk forward 2 steps. Step 4, pick up the cup. Now imagine swapping Step 2 and Step 4 โ the robot would try to pick up a cup that isn't even there yet!
When steps are in the wrong order and cause a mistake, we call that a bug. Finding the wrong step and fixing the order is called debugging โ just like a real coder does!
Sequences Are Everywhere
Getting ready for school is a sequence too. You put on underwear before pants, not after! Brushing your teeth, tying your shoes, and making breakfast all follow a first-then-next order.
Put these getting-ready-for-school steps in order by matching each step to its position.
Terms
Definitions
Drag terms onto their definitions, or click a term then click a definition to match.
What do we call it when the steps in a sequence are in the wrong order and cause a mistake?
Which step comes first when brushing your teeth?
Be the Sequence
With a grown-up or friend, pick a simple task, like making a sandwich or packing a backpack. Draw 4 boxes in a row. In each box, draw or write ONE step in order: first, then, next, last. Give your drawn steps to someone else and see if they can follow them in the right order!
Want to keep learning?
Sign up for free to access the full curriculum โ all subjects, all ages.
Start Learning Free