New
New
Year 10
AQA

List methods

I can use a list to return multiple values from a function.

New
New
Year 10
AQA

List methods

I can use a list to return multiple values from a function.

These resources will be removed by end of Summer Term 2025.

Switch to our new teaching resources now - designed by teachers and leading subject experts, and tested in classrooms.

These resources were created for remote use during the pandemic and are not designed for classroom teaching.

Lesson details

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.


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

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.
Teacher tip

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 (2025), 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

Download quiz pdf

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

When programmers write code, they use a special tool called an IDE (Integrated Development Environment). In an IDE, different colours are used to help programmers understand the code:


  • • Blue - numbers and boolean values
  • • Green - strings
  • • Purple - keywords

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

When programmers write code, they use a special tool called an IDE (Integrated Development Environment). In an IDE, different colours are used to help programmers understand the code:


  • • Blue - numbers and boolean values
  • • Green - strings
  • • Purple - keywords

Mercury
Venus
Correct answer: Earth
Mars

Assessment exit quiz

Download quiz pdf

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

When programmers write code, they use a special tool called an IDE (Integrated Development Environment). In an IDE, different colours are used to help programmers understand the code:


  • • Blue - numbers and boolean values
  • • Green - strings
  • • Purple - keywords

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

When programmers write code, they use a special tool called an IDE (Integrated Development Environment). In an IDE, different colours are used to help programmers understand the code:


  • • Blue - numbers and boolean values
  • • Green - strings
  • • Purple - keywords

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