Fields · Mixed Data Types · Lists of Records · Dictionaries in Python
CSZoneEdexcel GCSE Computer Science 1CP2
What is a Record?
Grouping Related Data
A record is a collection of related data items called fields. Unlike an array (one data type), a record can store different data types in a single structure. Like a row in a database table.
Example: a student record might have fields: name (string), age (integer), grade (string), enrolled (boolean)
A list of dictionaries is a common way to model a table (like a database) in Python
Exam Practice
Have a go at this question
Edexcel-style question
Describe what is meant by a record data structure and explain one advantage over using an array to store the same data.
3 marks
A record stores related data about a single entity in multiple named fields [1]. Unlike an array, a record can hold fields of different data types in one structure [1] — for example, a student record can store a name (string), age (integer), and enrolled status (boolean) together [1].
Key Takeaways
What to Remember
Record = group of named fields, each with its own data type
Can hold mixed types — unlike arrays which store one type
In Python: records implemented as dictionaries; access with ["key"]
List of dicts = table of records — common pattern for database-style data