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 create a list in Python and use selection to access and display list items.

Key learning points

  1. Lists are data structures that can store multiple related items in Python.
  2. Values held in a list are ordered by index number, with the first item in the list being stored at index [0].
  3. List items can be directly accessed by specifying the index value.

Keywords

  • Selection - used when there is more than one possible path for a program to follow

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

  • Data structure - a way of organising and storing data in a computer

  • Index - the location of items or elements in a list, array or string

Common misconception

A list index starts at 1 as that is the first element in the list and should be counted as the first item.

In most programming languages, list indexing is zero-based, which means the index starts at 0. The number indicates the position before the value is seen.

Teacher tip

Use the starter code to live model what happens when different index values are used to reference a list. It is important for pupils to see that errors can occur and why they have happened. Explain what the error messages are saying so that actions to debug become obvious.

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.
In Python, which keyword allows you to create a block of code that only executes when a certain condition is true?

Correct Answer: if

Q2.
Which if statement would correctly check if the variable score is greater than or equal to 80?

Correct answer: `if score >= 80:`
if score > 80:
if score = 80:
if score <= 80:

Q3.
Which of the following is correct when describing nested if statements?

The first condition needs to be False before the next condition can be run.
Correct answer: The first condition needs to be `True` before the next condition can be run.

Q4.
The = symbol in Python is used for ...

equations.
Correct answer: assignment.
comparison.

Q5.
What keyword is used in Python to output text to the user?

Correct Answer: print, print()

Q6.
S is used when there is more than one possible path for a program to follow.

Correct Answer: Selection, election

6 Questions

Q1.
What is the purpose of an elif statement in Python?

to create a loop
to define a function
Correct answer: to handle multiple conditions in a selection statement

Q2.
What is the correct syntax for creating a list in Python?

{“Monday”, “Tuesday”, “Wednesday”}
Correct answer: `[“Monday”, “Tuesday”, “Wednesday”]`
(Monday, Tuesday, Wednesday)

Q3.
What type of data structure is a list in Python?

static
Correct answer: dynamic

Q4.
Each item within the list is referred to by an , which is its position in the list.

Correct Answer: index, index number

Q5.
What will the following code print?
1234
days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] print(days[3])
Code colour

Wednesday
Correct answer: Thursday
IndexError
Tuesday

Q6.
What will the following code print?
1234
days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] print(days[7])
Code colour

Saturday
Sunday
Correct answer: IndexError

To help you plan your 9 computing lesson on: Creating lists in Python, download all teaching resources for free and adapt to suit your pupils' needs...