Choose exam board for KS4 Computer Science (GCSE)
Choose exam board for KS4 English
Choose exam board for KS4 French
Choose exam board for KS4 Geography
Choose exam board for KS4 German
Choose exam board for KS4 History
Choose tier for KS4 Maths
Choose exam board for KS4 Music
Choose exam board for KS4 Physical education (GCSE)
Choose exam board for KS4 Religious education (GCSE)
Choose exam board for KS4 Spanish

      Lesson details

      Learning outcome

      I can use count-controlled iteration to repeat a sequence of commands a set number of times.

      Key learning points

      1. Iteration can be used to repeat sequences of commands in a program.
      2. Condition-controlled iteration will execute until a condition is met or is no longer met.
      3. Count-controlled iteration will execute a set number of times.

      Keywords

      • Iteration - the process of repeating a sequence of instructions within a program loop

      • Count-controlled - a command that repeatedly runs a sequence of instructions a predefined number of times

      • Condition-controlled - a command that repeatedly runs a sequence of instructions until a condition is no longer being met

      Common misconception

      Iteration means a program will repeat something a set number of times.

      Count-controlled iteration will repeat a sequence of commands a set number of times. Condition-controlled iteration will repeat a sequence of commands until a condition is met and so the number of times it will repeat can never be predicted.

      Teacher tip

      The solution for Task B requires a variable to be decreased by 1 each time the loop is executed. Explore this with pupils by using a number of props in a container and providing a visualisation of removing an item during each iteration.

      Equipment

      Pupils will need access to a device with block-based programming software. Examples in this lesson use Scratch https://oak.link/scratch

      Licence

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

      Lesson video

      Loading...

      Prior knowledge starter quiz

      6 Questions

      Q1.
      What will be output when this program is executed?

      An image in a quiz
      Good afternoon
      How are you?
      Correct answer: Good afternoon How are you?
      Nothing will be output.

      Q2.
      What will be output when this program is executed?

      An image in a quiz
      Correct answer: Good afternoon How are you?
      How are you?
      Good morning Good afternoon How are you?
      Good morning How are you?

      Q3.
      Which conditions would evaluate as True with the following inputs?

      An image in a quiz
      Correct answer: number1 > 20 or number2 < 100
      Correct answer: number1 > 20 and number2 < 100
      number1 > 30 or number2 < 90
      number1 > 30 and number2 < 91

      Q4.
      =, < and > are all...

      Correct answer: comparison operators.
      logic operators.
      conditions.
      variables.

      Q5.
      and, or and not are all...

      Correct answer: logic operators.
      comparison operators.
      conditions.
      variables.

      Q6.
      Match the logic operator to the correct description.

      Correct Answer:and,True when both values are True

      True when both values are True

      Correct Answer:or,True when either or both values are True

      True when either or both values are True

      Correct Answer:not,True when the value is False

      True when the value is False

      Q1 Scratch is a project of the Scratch Foundation. It is available for free at https://scratch.org. OR ScratchJr is a project of the Scratch Foundation. It is available for free at https://scratchjr.org. OR Scratch Foundation under CC BY-SA 2.0 Q2 Scratch is a project of the Scratch Foundation. It is available for free at https://scratch.org. OR ScratchJr is a project of the Scratch Foundation. It is available for free at https://scratchjr.org. OR Scratch Foundation under CC BY-SA 2.0 Q3 Scratch is a project of the Scratch Foundation. It is available for free at https://scratch.org. OR ScratchJr is a project of the Scratch Foundation. It is available for free at https://scratchjr.org. OR Scratch Foundation under CC BY-SA 2.0 Q3 image 1 Scratch is a project of the Scratch Foundation. It is available for free at https://scratch.org. OR ScratchJr is a project of the Scratch Foundation. It is available for free at https://scratchjr.org. OR Scratch Foundation under CC BY-SA 2.0 Q3 image 2 Scratch is a project of the Scratch Foundation. It is available for free at https://scratch.org. OR ScratchJr is a project of the Scratch Foundation. It is available for free at https://scratchjr.org. OR Scratch Foundation under CC BY-SA 2.0 Q3 image 3 Scratch is a project of the Scratch Foundation. It is available for free at https://scratch.org. OR ScratchJr is a project of the Scratch Foundation. It is available for free at https://scratchjr.org. OR Scratch Foundation under CC BY-SA 2.0 Q3 image 4 Scratch is a project of the Scratch Foundation. It is available for free at https://scratch.org. OR ScratchJr is a project of the Scratch Foundation. It is available for free at https://scratchjr.org. OR Scratch Foundation under CC BY-SA 2.0

      4 Questions

      Q1.
      Match the keyword to the correct description.

      Correct Answer:count-controlled,repeatedly runs a sequence of instructions a set number of times

      repeatedly runs a sequence of instructions a set number of times

      Correct Answer:condition-controlled,repeatedly runs a sequence of instructions until a condition is met

      repeatedly runs a sequence of instructions until a condition is met

      Q2.
      Iteration can make a program more , rather than having to have lots of duplicate blocks.

      Correct Answer: efficient

      Q3.
      Which block is used in Scratch for iteration?

      Correct Answer: An image in a quiz
      An image in a quiz
      An image in a quiz
      An image in a quiz

      Q4.
      What will this code block do?

      An image in a quiz
      Correct answer: It reduces the value of life each time the repeat block executes.
      It increases the value of life each time the repeat block executes.
      It sets the value of life to -1.
      Q3 image 1 Scratch is a project of the Scratch Foundation. It is available for free at https://scratch.org. OR ScratchJr is a project of the Scratch Foundation. It is available for free at https://scratchjr.org. OR Scratch Foundation under CC BY-SA 2.0 Q3 image 2 Scratch is a project of the Scratch Foundation. It is available for free at https://scratch.org. OR ScratchJr is a project of the Scratch Foundation. It is available for free at https://scratchjr.org. Q3 image 3 Scratch is a project of the Scratch Foundation. It is available for free at https://scratch.org. OR ScratchJr is a project of the Scratch Foundation. It is available for free at https://scratchjr.org. OR Scratch Foundation under CC BY-SA 2.0 Q4 Scratch is a project of the Scratch Foundation. It is available for free at https://scratch.org. OR ScratchJr is a project of the Scratch Foundation. It is available for free at https://scratchjr.org. OR Scratch Foundation under CC BY-SA 2.0

      To help you plan your 7 computing lesson on: Count-controlled iteration, download all teaching resources for free and adapt to suit your pupils' needs...