Community resourceWorksheet
J277 2.2.3 One-dimensional arrays and Python lists
Part 2 of 5 · J277 2.2.3 · Strings, arrays and functions
One-dimensional arrays, represented in these worksheets by Python lists.
Students will:
- create a list and access elements by index
- update an element in place
- explain how an OCR array relates to a Python list
- avoid index errors at the start and end of a list
- build a list from a stated requirement
Inside: 5 explanation cells, 3 runnable Python tasks, 2 multiple-choice questions, 1 fill-in-the-blanks cell and 2 written answers. 16 marks, about 45 minutes.
Series: J277 2.2.3 · Strings, arrays and functions, part 2 of 5.
Shared by Coding PathwayVerified teacher
- 13 cells
- About 45 minutes
- CC BY-SA 4.0
- Shared 17 Aug 2026
- Updated 9 Sept 2026
Preview
The whole resource, exactly as a class sees it. Answers and marking are held back.
One-dimensional arrays and Python lists
An array stores several values under one name, with individual elements accessed by an index. OCR describes arrays as fixed-length structures whose elements share one data type. In Python worksheets we use a list to represent this structure, while remembering that Python lists can change length and can technically mix data types.
Python uses zero-based indexing: the first element is at index 0, the second at index 1 and the third at index 2. An index identifies one position; it is not the same as the everyday counting number of that item.
The value and its index are different: 17 is the value stored in the second element, while 1 is the index used to access it.
Which expression selects the third element of scores in Python?
- Ascores[2]
- Bscores[3]
- Cscores(2)
- Dscores.third
Creating and accessing a one-dimensional structure
scores = [12, 17, 15, 20]
scores[1] = 18
The list holds four related integer values. Index 1 selects the second element, so the assignment changes 17 to 18. Use an array or list when several values have the same purpose and are processed in a similar way.
OCR Exam Reference Language can declare the same fixed array as array scores = [12, 17, 15, 20]. Both notations use square brackets and zero-based indices to access an element. Keep using Python for runnable answers, but recognise OCR's array keyword when it appears in a question.
Before running the example below, predict both lines of output. Identify which statements retrieve elements and which statement updates an element in its existing position.
days = ["Mon", "Tue", "Wed", "Thu", "Fri"]
temperatures = [14, 16, 15, 17, 13]
print(days[0], temperatures[0])
temperatures[4] = 14
print(temperatures)
- record
- index
- element
- constant
- list
Supported practice: read and update elements
The list scores represents four array elements. Correct the second score to 19, remembering that the second element is at index 1. Then select the final element and store it in last_score.
Do not rebuild the whole list. This task is about using indices to update and retrieve individual elements.
scores = [14, 16, 18, 20]
# 1. Update the second element.
# 2. Select the final element and store it in last_score.
Why is a list suitable for storing the lap times of eight runners?
- AIt guarantees every value is Boolean
- BIt stores related values that can be accessed by position
- CIt removes the need for meaningful data
- DIt can contain only one value
Independent practice: create and access a list
Create a list named rainfall containing the five values 3, 0, 5, 2, 4 in that order. Then use zero-based indexing to store the first element in first_day and the fourth element in fourth_day.
The zero is genuine rainfall data and must remain in the list; it is not an unfinished placeholder.
# Create a list named rainfall containing 3, 0, 5, 2 and 4.
# Store its first and fourth elements in first_day and fourth_day.
Explain why a Python list is useful for practising OCR array problems but is not exactly the same as a fixed-length array.
Give one similarity and one difference.
Students type their answer here.
A student writes teams[4] to select the fourth team. Correct the expression and explain the error.
Assume the first team is at index zero.
Students type their answer here.
Review
An array groups related values of one data type under one name and uses an index to identify each element. In these Python activities, lists represent OCR-style arrays. Remember the important distinction: OCR's array model has a fixed length, while a Python list can grow or shrink and can technically mix types.