GCSE · Computer Science · Edexcel · Spec 1CP2
Records
Every player who joins a game fills in the same form: username, password, top score. The boxes never change; only the answers do. That is a record.
Computer Science · Records
One player, one record: sort every piece
Is each piece the entity, an attribute or data?
Still to sort
Entity (0)
The one thing the record is about: a single object, place, person or thing.
Where the line is: The entity is the whole player. It is not any one fact about the player.
Attribute (0)
A property of the entity, like the label on a box in the form. Also called a field.
Where the line is: An attribute is the label on the box. Whatever gets written in the box is data.
Data (0)
The actual value stored for one attribute.
Where the line is: Data can differ from one player to the next. The attributes stay the same for every player.
Here is one player’s record taken apart, plus three pieces from a second player. Pick a piece, then pick its job.
Computer Science · Python
Build a record in Python, then read it and change it
Python has no built-in record type. Instead, a dictionary does the job: curly brackets, with each key paired with its data.
Before you reach step 3, predict: what will player["Password"] hold after line 5 runs?
1 player = {"Username": "rockstar9",2 "Password": "6goatsEating",3 "TopScore": 5328}4 print(player["Username"])5 player["Password"] = "7goatsDancing"6 print(player["Password"])
Variables
Output
Step 1: Lines 1–3 are one statement. The curly brackets make a dictionary, and each key ("Username", "Password", "TopScore") is paired with its data. This dictionary is one player’s record.
Step through the code and watch the record change. Every value shown is written into the lesson; the page runs no code.
Computer Science · Data structures
Explore
Tap a part of the diagram, or choose one below.
A data structure keeps data organised so you can reach any piece of it. Tap each part to see how you get from the whole list to one single value.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
One entity, a fixed set of attributes, and the data that fills them in.
What you need to know
- Data structures store data in an organised, accessible way, and a record is one example.
- A record stores a collection of attributes for a single entity.
- An entity is a single object, place, person or thing. Attributes (fields) are its properties or characteristics, and data is the values stored in them.
- A record is static: its attributes and data types are decided at declaration and are then fixed for every record in the database.
- A database holds many records for a particular entity, such as many player records.
- In Python a dictionary (curly brackets) can represent a record. A key locates the data, e.g. player["Username"], and assigning to a key changes the data.
- Many records can be stored as a list of dictionaries with exactly the same structure, and players[0] is the record at position 0.
The big picture
A record is a data structure that stores the attributes of a single entity, such as one player in a game. The entity is what the record is about, the attributes (fields) are its properties, and the data is the values stored in them. A record is static: its attributes and data types are fixed at declaration, so every record in a database shares one structure. A database holds many records for the same kind of entity. In Python, a dictionary represents a record, keys find and change its data, and a list of dictionaries holds many records.
Key points
Worked example
Problem
players is a list of player records, each a dictionary with the keys "Username", "Password" and "TopScore". Write one line of Python that changes the password in the record at position 0 to "luckyOtter3".
⚠ Watch out
Mixing up an attribute with its data. "Username" is the attribute: the property every record has. "rockstar9" is the data stored in it for one player. Quick test: every player has the same attributes, and the data is what one player’s record holds in them.
Memory hook
Same form, different answers. The entity is who the form is about, the attributes are the questions on the form, and the data is the answers.
Check yourself
Without scrolling up: for one player’s record, name the entity, one attribute and its data. Then say what makes a record static, and write the Python that reads player’s "TopScore".
Flashcards
(13)What is a data structure for?
What does a record store?
What is an entity?
What is an attribute, and what is its other name?
Attribute or data: how do you tell them apart?
What is a database?
Why is a record called a static data structure?
How does pseudocode declare a record structure?
Does Python have a built-in record data structure?
In a Python dictionary record, how do you find one attribute’s data?
How do you change the data in a dictionary record?
How do you store many records in Python?
What does players[0] give you?
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 Edexcel GCSE Computer Science topics
How this lesson was checked. This Edexcel GCSE Computer Science (specification 1CP2)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 September 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.