icon-background-square
New
New
Year 10
OCR

Using selection when developing programs

I can describe how selection statements are used in programs to control program flow.

icon-background-square
New
New
Year 10
OCR

Using selection when developing programs

I can describe how selection statements are used in programs to control program flow.

warning

These resources will be removed by end of Summer Term 2025.

Switch to our new teaching resources now - designed by teachers and leading subject experts, and tested in classrooms.

Lesson details

Key learning points

  1. Selection is used when there is more than one possible path for a program to follow.
  2. Selection is carried out using if, elif and else statements.
  3. A selection statement will check if a condition returns as True or False.
  4. Multi-path selection is used when there is more than one path for a program to follow.

Keywords

  • Selection - used when there is more than one possible path for a program to follow

  • Condition - an expression that evaluates to True or False

  • Multi-path selection - selection when there is more than one path for a program to follow

Common misconception

A program follows a sequence of instructions and will run all lines of code.

Selection statements can be used to control program flow, so some lines of code can be skipped to follow a different path through the program.


To help you plan your year 10 computer science lesson on: Using selection when developing programs, download all teaching resources for free and adapt to suit your pupils' needs...

Pupils may find the come across syntax errors with missing : and indentation in selection statements. Encourage them to self check programs for these pitfalls.
speech-bubble
Teacher tip
equipment-required

Equipment

All pupils requires access to devices that can edit and run Python programs. Starter code files are available to copy or use directly via the Raspberry Pi Code Editor.

copyright

Licence

This content is © Oak National Academy Limited (2025), licensed on Open Government Licence version 3.0 except where otherwise stated. See Oak's terms & conditions (Collection 2).

Lesson video

Loading...

6 Questions

Q1.
Which flowchart symbol is sued to represent a decision?
An image in a quiz
Correct Answer: An image in a quiz
An image in a quiz
An image in a quiz
Q2.
Which of the following is the correct syntax for a print statement in Python?
print(Hello)
Print(Hello)
Correct answer: `print("Hello")`
print (Hello
Q3.
What does an IF statement represent?
Correct answer: a question
an answer
a variable
an iteration
Q4.
In programming what is the answer to an IF question?
Yes or No
Wrong or Right
1 or 0
Correct answer: True or False
Q5.
is used when there is more than one possible path for a program to follow.
Correct Answer: selection
Q6.
What statement is used to obtain a value for a variable from a user?
print()
if
get()
Correct answer: `input()`

6 Questions

Q1.
What is the purpose of selection in programming?
to repeat a set of instructions multiple times
Correct answer: to allow a program to follow different paths based on conditions
to create a new variable
to execute all lines of code in a program
Q2.
Which of the following is used for selection in Python?
for loop
while loop
Correct answer: if statement
function definition
Q3.
What will be the output of the following code?
12345
number = 10 if number > 5: print(number + 5) else: print(number - 5)
10
5
Correct answer: 15
20
Q4.
A condition in programming is an expression that evaluates to either or False.
Correct Answer: True
Q5.
The statement is used when there are multiple conditions to check one after another.
Correct Answer: elif, else if
Q6.
What will the following program output?
1234
score = 30 if score > 30: print("You won!") print("The end")
You won!
You won! The end
Correct answer: The end