Year 10 (ages 14–15, Grade 9 in the US) · Computing · GCSE programming · Lesson 8
2D lists and records
Storing tables of data in two-dimensional lists, accessing items with [row][column], looping through rows and columns with nested loops, and using lists of records to keep related data together.
Exam boards: this lesson matches the AQA and Pearson Edexcel GCSE computing courses. Check which course your school follows.

8-minute video lesson
Teaching, worked examples and 20 practice questions solved step by step.
Watch free for a monthWhat your child will learn
- Explain a 2D list
- Access elements with [row][column]
- Loop through a 2D list
- Use records to store related data
The method
- A 2D list is a list of lists — like a table.
- grid[row][column]; both start at 0.
- Outer loop over rows; inner loop over columns.
- A record groups different fields about one thing.
Key words: 2D list, row, column, nested loop, record.
Worked examples
Worked examples from the lesson, with every step.
Question 1
grid = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]. What is grid[2][0]?
- Step 1: [7, 8, 9]
- Step 2: 7
Answer: 7
Question 2
Same grid: what is grid[1][1] + grid[0][2]?
- Step 1: grid[1][1] = 5; grid[0][2] = 3
- Step 2: 5 + 3 = 8
Answer: 8
Question 3
Find the total of all values in grid.
- Step 1: 6 + 15 + 24
- Step 2: = 45
Answer: 45