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 a list to return multiple values from a function.

      Key learning points

      1. List methods can be use to alter the contents of a list.
      2. A function returns a value.
      3. Sometimes you need a function to return more than one value.
      4. A list is a method that you can use to return more than one value from a function.

      Keywords

      • Append - add an item to the end of a list

      • Insert - add an item to a given position in a list

      • Pop - remove an item from a given index in a list

      • Count - counting the number of occurrences of a given item

      Common misconception

      A function can only ever return one value.

      A list can be used to return multiple values from a function.

      Teacher tip

      This lesson uses functions. If pupils are unfamilar with this concept or need to revisit it, it may be worth covering this before this lesson.

      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.

      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.
      Match the term to its description.

      Correct Answer:static,a data structure that has a fixed size in memory

      a data structure that has a fixed size in memory

      Correct Answer:dynamic,a data structure that can grow or shrink to accommodate items

      a data structure that can grow or shrink to accommodate items

      Correct Answer:array,a static data structure that contains items of the same data type

      a static data structure that contains items of the same data type

      Correct Answer:list,a dynamic data structure that can contain items of different types

      a dynamic data structure that can contain items of different types

      Q2.
      An is fixed in size and can only contain data of the same type.

      Correct Answer: array

      Q3.
      Which of the following are characteristics of a list?

      Correct answer: items don't have to be of the same data type
      Correct answer: dynamic data structure
      static data structure
      Correct answer: items can be added or deleted
      is a fixed size

      Q4.
      Which brackets are used when defining a list in Python?

      {}
      ()
      Correct answer: []

      Q5.
      What is the identifier in this list?
      1234
      planets = ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Neptune", "Saturn"]
      Code colour

      Correct Answer: planets

      Q6.
      In this list, which item is held in index position 2?
      1234
      planets = ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Neptune", "Saturn"]
      Code colour

      Mercury
      Venus
      Correct answer: Earth
      Mars

      6 Questions

      Q1.
      What does the append() method do?

      removes an item from a list
      adds an item to a specific position in a list
      Correct answer: adds an item to the end of a list
      counts occurrences of an item in a list

      Q2.
      Which method would you use to remove an item from a list at a specific index?

      remove()
      Correct answer: `pop()`
      delete()
      discard()

      Q3.
      What will be the output of this code?
      12
      shopping = ["bread", "cheese", "milk"] print(shopping.count("cheese"))
      Code colour

      0
      Correct answer: 1
      cheese
      3

      Q4.
      If no argument is provided to the pop() method, which item is removed from the list?

      the first item
      Correct answer: the last item
      no items

      Q5.
      What will be the output from this code?
      123
      numbers = [3, 6, 9, 12] numbers.insert(2, 15) print(numbers)
      Code colour

      Correct answer: `[3, 6, 15, 9, 12]`
      [3, 6, 9, 12, 15]
      [15, 3, 6, 9, 12]
      [2, 3, 6, 15, 9, 12]

      Q6.
      What does the remove() method do?

      removes the last item from a list
      Correct answer: deletes an item by its value
      removes an item at a specific index
      clears all items from a list

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