Making Decisions
Making Decisions
Life is full of decisions: "IF it's raining, take an umbrella, ELSE wear sunglasses." Programs work the same way. Selection lets programs choose different paths based on conditions. IF the user enters the correct password, let them in. ELSE, show an error. Multiple choices? Use ELSEIF or SWITCH/CASE. Every game, every app makes thousands of decisions every second!
Now try it yourself
Quiz · Question 1 of 15
Which programming construct is used to make a decision based on a condition?
Tap an answer to check it
This topic in real past papers
Every real exam question we've found on selection (if statements), with a full worked answer.
AQA Paper 1
Both sittings we have full papers for ask you to write a complete Python program using selection to apply a real-world set of rules, worth 5 to 7 marks. June 2022 asked for this twice (an email checker and a bonus calculator); June 2023 asked once (a theme park discount calculator).
OCR Paper 2
All three sittings we have full papers for ask you to write a complete function or procedure from a stated specification, worth 4 to 6 marks: a price-calculating function in June 2022, a file-saving procedure in June 2023, and a position-updating function in June 2024.