What does selection mean?
Choosing which instructions to run depending on whether a condition is true or false: an if statement. One of the three basic programming constructs.
In a lesson
Every program so far did the same thing every time. A robot that only does that is a toy. From this lesson on, your programs look at the world and choose. Choosing which lines run is called selection.
Learn it
- Taught in F2.2 Selection: if Decisions and loops, GCSE
Used in
- F1.1 What a program is
- F2.1 Blocks and indentation
- F2.3 else, elif and Boolean operators
- F2.4 Nested selection and match
- F2.8 Project: parking sensor
- F5.3 Pseudocode and the exam reference language
- F13.9 Project: the revision robot
- A1.1 Data types and programming constructs
- A1.6 Programming paradigms and procedural programming
- A2.7 Thinking ahead and thinking logically
and 5 more lessons.
Do the lesson in the simulator