Arrays, 2D arrays and records
When a program has lots of related values, store them together in a data structure instead of in dozens of separate variables.
One-dimensional arrays (lists)
Items are numbered from 0: scores[0] is 12 and scores[2] is 19.
len(scores) gives 4. scores.append(10) adds 10 to the end.
scores[1] = 8 changes the second item.
In Python, arrays are written as lists.
Two-dimensional arrays
grid = [[3, 8, 1], [6, 2, 9]]
grid[row][column]: grid[1][2] is row 1, column 2, which is 9.
| Item | col 0 | col 1 | col 2 |
|---|---|---|---|
| row 0 | 3 | 8 | 1 |
| row 1 | 6 | 2 | 9 |
Records
student = ["Zara", 15, 62.5, True] (name, age, height, member)
A table of students can be stored as a list of records.
temps = [14, 17, 12, 20]. Find the average with a loop.
- Add the items: 14 + 17 + 12 + 20 = 63
- Divide by len(temps) = 4
Answer: 15.75
Lists (arrays) store many values under one name, indexed from 0. A 2D array is a list of lists: grid[row][column]. A record groups related fields of different types.
- Array
- A data structure holding many items of the same type under one name, accessed by index (a list in Python).
- Record
- A data structure grouping related fields that can be of different types.
All GCSE and International GCSE Computer Science key terms and definitions →
Try two quick questions
See if it has sunk in. Answers are marked straight away.
2 more questions
Try each one, then tap to check.
scores = [9, 14, 6, 21]. What is scores[3]?
Show the answer
Answer: 21
Index 0 is 9, 1 is 14, 2 is 6, 3 is 21.
What does this print?
names = ["Ali", "Bea", "Cai", "Dev"]
names.append("Eve")
names.append("Fin")
print(len(names))Show the answer
Answer: 6
There were 4 names and 2 were appended: 6.
Check you have got it
Answer 6 quick questions with instant marking. If you get one wrong, GCSE-ready shows you why and gives you another go. It is free, and you do not need an account.
- Pearson Edexcel GCSE Computer Science (1CP2) specification, topic 1.2.2, 6.3.1
- Pearson Edexcel International GCSE Computer Science (4CP0) specification, topic 2.3.2
Facts checked against the sources below, 17 October 2026. Last updated 2 October 2026. Spotted a mistake? Tell us and we will fix it.
What do exam command words like explain and evaluate mean? →