GCSE · Computer Science · AQA · Spec 8525
Records
One car: make, model, reg, price, number of doors. Three bits of text, two numbers. How do you keep all five under ONE name?
Computer Science · Data structures
Everything about one car, in one variable
A record is a data structure: a way of storing data so it stays organised and easy to get at. Step through this short Python program and keep your eye on the Variables panel.
Before you press Next, make a guess: how many variables does this program need to hold everything about one car?
1 car1 = {"make": "Ford",2 "model": "Fiesta",3 "reg": "AB12 CDE",4 "price": 8495.0,5 "noOfDoors": 5}6 print(car1["model"])7 car1["price"] = 7995.08 car2 = {"make": "Vauxhall",9 "model": "Corsa",10 "reg": "CD34 EFG",11 "price": 6250.0,12 "noOfDoors": 3}13 cars = [car1, car2]14 print(cars[1]["reg"])
Variables
Output
Step 1: Five lines, one statement, and just ONE new variable: car1. Each labelled piece (make, model, reg, price, noOfDoors) is a field. Three hold text, price holds a real number, noOfDoors a whole number. Different types, one car. That's a record.
Press Next one step at a time. Each step highlights the line that has just run, and the Variables panel shows what's stored.
This Car definition, in the RECORD … ENDRECORD layout, is the example record given in the AQA specification.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
One name for everything you know about one thing.
What you need to know
- A data structure stores data in an organised, accessible way, and a record is one example of a data structure.
- A record stores a collection of attributes about a single entity, such as one car.
- Each attribute sits in a field: make, model, reg, price and noOfDoors are the Car record's fields.
Have a goBiscuit the hamster is getting her own record in a pet-shop app. Name two fields she could have, and one thing that would NOT be a field of her record.
e.g. name and age. Not a field: how many hamsters the shop has.
A field holds an attribute of the one entity, Biscuit. A shop-wide count describes the whole collection, so it doesn't belong in her record.
- Fields in one record can be different data types: String for text, Real for decimals, Integer for whole numbers.
Have a goA racing game stores a player's name, their level, and their best lap time in seconds (like 42.7). Which data type fits each field?
name : String, level : Integer, best lap : Real.
Mixing types in one record is fine. A lap time like 42.7 has a decimal part, so Integer would lose the .7: it needs Real.
- A record definition opens with RECORD and the record's name, lists one name : Type line per field, then closes with ENDRECORD.
- Python has no built-in record, so a dictionary represents one, with each field name as a key.
- Read or change a field with its key in square brackets, quotes included: car1["price"].
Have a goplayer = {"name": "Mo", "score": 40}. Mo scores 10 more points. Write ONE line that updates his score.
player["score"] = 50 (or player["score"] = player["score"] + 10)
Name the record, then the field's key in quotes, then assign. Only score changes; name stays exactly as it was.
- Got lots of entities? Make one dictionary each and keep them all in a list: cars = [car1, car2].
- To solve a problem with records, loop through the list and ask each record for the field you need.
The big picture
A record groups the attributes of one entity, like one car, under a single name. Its fields can be different data types. Python has no built-in record, so each record is a dictionary, and many records are kept in a list.
Key points
Worked example
Problem
A sports club keeps a record for each member with the fields name : String, age : Integer and feesPaid : Boolean. Write Python to store a member called Priya, aged 15, who has paid, add her to a list called members, then output her age.
⚠ Watch out
Leaving the quotes off a field name. It looks harmless, but car1[price] makes Python hunt for a variable called price, and there isn't one. car1["price"] asks the record for its price field.
Memory hook
One form per car: the boxes are fields, the form is the record, the stack of forms is the list.
Check yourself
Cover the page. What does one record hold, and how would you store three records in Python?
Flashcards
(11)What is a data structure for?
What does a record store?
What is an entity?
What is a field?
Must all the fields in a record be the same data type?
Which two keywords open and close a record definition?
How is each field written inside a record definition?
Does Python have a built-in record data structure?
Record definition vs Python dictionary: which one holds actual values?
How do you read the reg field of the dictionary car2?
How do you store many records in Python?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore AQA GCSE Computer Science topics
How this lesson was checked. This AQA GCSE Computer Science (specification 8525)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 30 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.