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

      Mathematical operations in data structures

      Lesson details

      Learning outcome

      I can perform a range of mathematical operations on list items and return a result.

      Key learning points

      1. Mathematical operations can be performed using operators in Python.
      2. Mathematical operations can be performed on individual list items.
      3. The shuffle() function can be used to randomly reorder the contents of a list.

      Keywords

      • Operator - a symbol or word that instructs the computer to perform a specific calculation or action

      • List - a dynamic data structure that can contain items of different data types

      Common misconception

      Mathematical operations cannot be performed on items held in a list; the items must first be stored in a new variable.

      Mathematical operations can be performed directly on list items by using an index value to reference the value used.

      Teacher tip

      Unplugged activites help to visualise tasks away from the computer screen. If you think pupils will struggle to understand the tasks, try rehersing them in groups with printed versions of the lists so that the effect of instructions can be visualised.

      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 a list in Python?

      a single-value data type
      a type of loop
      a function to perform calculations
      Correct answer: a collection of data in a particular sequence

      Q2.
      Match the terms with their definitions.

      Correct Answer:string,a collection of characters
      Correct Answer:mutable,able to be changed
      Correct Answer:index ,the location of an item in a list

      Q3.
      What is the index number that holds the first item in a Python list?

      -1
      Correct answer: 0
      1
      2

      Q4.
      What method would you use to add an item to a list?

      remove()
      sort()
      Correct answer: `append()`
      index()

      Q5.
      What is the term for repeating a sequence of instructions?

      Correct Answer: iteration

      Q6.
      Which loop is used for count-controlled iteration?

      Correct Answer: for, for loop

      6 Questions

      Q1.
      Match the terms with their definitions.

      Correct Answer:operator,a symbol or word that instructs the computer to perform a calculation
      Correct Answer:list,a collection of data in a sequence
      Correct Answer:shuffle,randomly reorder the contents of a list
      Correct Answer:string,a collection of characters
      Correct Answer:immutable,not able to be changed

      Q2.
      What is the primary purpose of a for loop in Python?

      to execute code indefinitely
      Correct answer: to repeat a block of code a specific number of times
      to handle errors in code
      to define variables

      Q3.
      What is the index of the second item in a list?

      Correct Answer: 1, one

      Q4.
      What can be used to perform calculations in Python?

      variables
      Correct answer: operators
      loops
      strings

      Q5.
      Which statement about performing mathematical operations on list items in Python is true?

      Items must be copied to a new variable first.
      Operations are only for lists with numbers.
      Correct answer: Operations can be performed directly on list items.
      Items need to be converted to strings for operations.

      Q6.
      What does the shuffle() function do to a list in Python?

      sorts the list in ascending order
      reverses the order of the list
      Correct answer: randomly reorders the list items
      removes duplicates from the list

      To help you plan your 9 computing lesson on: Mathematical operations in data structures, download all teaching resources for free and adapt to suit your pupils' needs...