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

      Developing programs using sequence

      Lesson details

      Learning outcome

      I can explain how sequence of a program affects the output it produces.

      Key learning points

      1. Computers execute the instructions within a program in a sequential manner to produce output.
      2. Changes to the sequence of code affects the output.

      Keywords

      • Sequence - the order of commands in a program

      • Debugging - the process of finding and fixing errors in code to ensure it works correctly

      Common misconception

      As long as all the necessary lines of code are present, the program will work, regardless of their order.

      Computers run code line by line, in the order it's written. If you change the sequence, you're changing the steps the computer takes, and that will change the output.

      Teacher tip

      Discuss the order of traffic lights to demonstrate how sequence affects outcomes, similar to how it affects programs. Ask pupils to identify other similar sequences they encounter in their everyday lives.

      Equipment

      Pupils will need access to a device that can edit and run Python programs. Examples in this lesson use the RPF Code Editor https://oak.link/python-editor

      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 is input in a computer system?

      Correct answer: data sent to a program to be processed
      information produced after processing
      a type of storage device
      a program written in code

      Q2.
      What is output in a computer system?

      data sent to a program to be processed
      Correct answer: information produced by a computer after processing
      a way to store information
      a type of input device

      Q3.
      Which of these is an example of input?

      a printed document
      Correct answer: typing on a keyboard
      a displayed image on a screen
      a sound played by speakers

      Q4.
      Which of these is an example of output?

      clicking a mouse button
      pressing keys on a keyboard
      speaking into a microphone
      Correct answer: a graph displayed on a monitor

      Q5.
      What does the sequence in a program determine?

      the colour of the output
      the type of input devices used
      Correct answer: the order in which tasks are processed
      the speed of the computer

      Q6.
      What Python code is used to take input from the user and store it in a variable called 'name'?

      Correct Answer: name = input(), name=input()

      6 Questions

      Q1.
      What is the process of finding and correcting errors in a program called?

      Correct Answer: debugging, Debug

      Q2.
      Put these steps in order to produce the correct output from a program.

      1 - Write the code in the correct sequence.
      2 - Execute the program.
      3 - Debug the program if necessary.

      Q3.
      What does the sequence of a program determine?

      the speed of the program
      the type of input devices used
      the colour of the output
      Correct answer: the order in which tasks are executed

      Q4.
      What happens if the sequence of code in a program is incorrect?

      The program runs faster.
      Correct answer: The program may produce unexpected results.
      The program will always crash.
      The program ignores the sequence.

      Q5.
      What does debugging involve?

      adding new lines of code
      writing a program from scratch
      rearranging the sequence of code
      Correct answer: finding and correcting errors in program code

      Q6.
      Why does the order of code in a program matter?

      because computers run code randomly
      Correct answer: because computers execute instructions line by line
      because computers ignore the sequence of code
      because the order of code determines the speed of execution

      To help you plan your 10 computer science lesson on: Developing programs using sequence, download all teaching resources for free and adapt to suit your pupils' needs...