Lesson 2 of 4 · 7 minutes
Instructions and programs
A program is a list of instructions. The computer does them in order, from top to bottom. This is the order of execution.
Think about getting dressed. Socks first, then shoes works. Shoes first, then socks does not. Same steps. Different order. Different result.
Steps that happen one after another form a sequence. Sometimes order does not matter. But often it does. Read a program top to bottom, one step at a time.
Same steps. Different order. Different result.
Try it
Read these instructions from top to bottom:
First get a glass
Then pour the milk
Now drink itWhat would go wrong if you poured the milk before getting a glass?
Quick check
You can now read a program the way a computer does: in order, top to bottom.