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 define a variable as something that is changeable.

      Key learning points

      1. Data can be stored as a variable.
      2. The way a variable changes is defined by the programmer.
      3. Variables can be used to store numbers or letters.

      Keywords

      • Change - to update the value of something in a program

      • Variable - a named piece of data stored in a computer’s memory which can be accessed and changed by a computer program

      • Name - the label given to a variable so that the programmer knows what it is for

      • Value - the numbers or text stored in a programming variable which can be used or changed

      Common misconception

      Variables are only for numbers.

      Variables aren't just for numbers, they can also hold letters.

      Teacher tip

      You need to be aware of the concept of variables in programming. In this lesson, a �variable� is defined as something that can be set and changed throughout the running of a program.

      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 is the character or object you can control in Scratch called?

      Correct Answer: sprite, a sprite

      Q2.
      What is the stage in Scratch?

      where your code blocks are stored
      a type of sprite
      the sound settings
      Correct answer: the area where sprites move and appear

      Q3.
      What does an event block do in Scratch?

      changes the colour of a sprite
      Correct answer: starts a set of code blocks when something happens
      makes your project go faster
      deletes a sprite

      Q4.
      What happens when you use a forever loop in Scratch?

      Correct answer: the code inside runs over and over without stopping
      the code runs once
      the sprite disappears
      the background changes

      Q5.
      Put these steps in order for making a sprite move when the green flag is clicked:

      1 - add a sprite to the stage
      2 - add the "when green flag clicked" block
      3 - add the move 10 steps block
      4 - click the green flag to start

      Q6.
      What is the purpose of the "repeat" block in Scratch?

      to stop all scripts
      to delete the sprite
      to change the sprite’s colour
      Correct answer: to do the same action several times

      6 Questions

      Q1.
      What is a variable in a computer program?

      Correct answer: a named piece of data stored in a computer’s memory
      a type of sprite
      the background of the stage
      a sound effect

      Q2.
      What is the label given to a variable called?

      Correct Answer: name

      Q3.
      What can a variable store?

      only numbers
      only pictures
      only sounds
      Correct answer: numbers or letters

      Q4.
      Put these steps in order for using a variable in a project:

      1 - Decide what information you need to store.
      2 - Create a variable and give it a name.
      3 - Set the starting value of the variable.
      4 - Change the value as the programme runs.

      Q5.
      Who decides how a variable changes in a program?

      the computer
      the internet
      Correct answer: the programmer
      the sprite

      Q6.
      Put these actions in order for changing a variable’s value during a game:

      1 - The player scores a point.
      2 - The program adds 1 to the score variable.
      3 - The new score is shown on the screen.
      4 - The player keeps playing.

      To help you plan your 6 computing lesson on: Introducing variables, download all teaching resources for free and adapt to suit your pupils' needs...