You want protection against accidental modification
Can be used as dictionary keys (unlike lists)
LIST — USE WHEN:
Data needs to change (add, remove, sort)
Collection size may vary
Mutable — can append, delete, sort
Lists
Lists — Dynamic & Mutable
A list is an ordered, mutable collection that can grow or shrink at runtime. In Python, it is the default sequence type.
PYTHON LIST OPERATIONS
items = [3, 1, 4, 1, 5] items.append(9) ← add to end items.insert(0, 7) ← insert at position items.remove(1) ← remove first occurrence items.sort() ← sort in place len(items) ← length
AQA Pseudocode Lists
Lists in AQA Pseudocode
shopping ← [] ← empty list shopping.append("milk") shopping.append("bread") shopping.append("eggs")
FOR item IN shopping OUTPUT item ENDFOR
shopping.remove("bread")
Comparison
Records, Tuples, Lists — Summary Table
Feature
Record
Tuple
List
Ordered
Fields named
Yes
Yes
Mutable?
Yes
No
Yes
Mixed types?
Yes
Yes
Yes
Fixed size?
Yes (fields)
Yes
No
Python type
class/dict
tuple ()
list []
AQA Exam Style
Practice Question
AQA 7517 — Paper 1 Style
A school stores data about each pupil, including: name (string), date of birth (string), year group (integer), and whether they have paid fees (Boolean).
(a) State the most appropriate data structure to store a single pupil's data. Justify your answer. [2] (b) Explain why a tuple would be appropriate for storing the date of birth. [2]
[4 marks]
2 marks
(a) Record — because it can hold multiple fields of different data types (name=string, dob=string, yeargroup=integer, feesPaid=boolean)
2 marks
(b) Date of birth is immutable — it cannot change, so a tuple prevents accidental modification
Summary
Key Points to Remember
Record — named fields of different types; models real-world entities
Tuple — immutable ordered collection; use when data shouldn't change
List — mutable, dynamic; can append/remove/sort; most flexible
Array: fixed-size, same type; List: dynamic, any type (Python)