Unit 6 · Lesson 4
Build the idea
Start with the concept and its key vocabulary.
OCR ERL uses switch/case for a multi-way choice based on one value. Put a colon after the switch expression, each case value and default. Only the matching case runs; default handles unmatched values. This is selection, not iteration. Python can express the same beginner-level decision with if/elif/else.
A selection structure that checks one expression against several possible values.
One value that may match the switch expression and select its instructions.
The fallback branch used when no case value matches.
The OCR ERL keyword that closes a switch structure.