Unit 6 · Lesson 2
Build the idea
Start with the concept and its key vocabulary.
Selection lets a program choose what to do. An if branch runs when its condition is true. An else branch handles every remaining case. Add elseif in ERL or elif in Python when there are several possible conditions. The program takes the first true branch, so their order matters.
Using a condition to decide which path through a program is executed.
One possible path through a selection statement.
The first condition in an if selection structure.
A later condition checked only when all earlier branches were false.
The fallback branch used when no earlier condition was true.