Structured data types (Edexcel GCSE Computer Science): Revision Notes
Structured data types
What are data structures?
A data structure is simply an organised way of storing multiple pieces of information together. Think of it like different types of containers - some hold similar items, others can hold a mix of different things. In programming, we use data structures to keep related information neat and accessible.
The container analogy is helpful to remember: just like real containers, different data structures are designed for different purposes - some are better for organising similar items, while others can handle a variety of different things.
Data structures can be one-dimensional (like a single row of items) or two-dimensional (like a table with rows and columns). In Python, these are created using lists, which makes them very practical to work with.
Arrays
Understanding arrays
An array is a special type of data structure where all elements must be the same data type. This is like having a box that can only hold one type of item - maybe all strings, all numbers, or all boolean values.
Key Array Characteristic: Arrays are homogeneous - they can only contain elements of the same data type. You cannot mix strings, numbers, and booleans in a single array.
Arrays can be:
- One-dimensional: A single list of items (like a row of books)
- Two-dimensional: Multiple rows of items (like a grid or spreadsheet)
How arrays work in practice

Let's look at how arrays work with a practical example. When you create an array, you can access individual elements or groups of elements using their position numbers (called indices).
Worked Example: Array Access Patterns
colourArray = ["DeepPink", "LemonChiffon", "CornflowerBlue"]
rgbArray = [[255, 20, 147], [255, 250, 205], [100, 149, 237]]
Accessing array elements:
colourArray[1]gets you "LemonChiffon" (the second item, since counting starts at 0)rgbArray[1]gets you the entire second row: [255, 250, 205]rgbArray[1][2]gets you a specific number: 205 (row 1, position 2)
The important rule is: you need one index per dimension to access exactly what you want.
Records
What makes records different
Records are quite different from arrays because elements can be different data types. While an array might contain only strings or only numbers, a record can mix text, numbers, and other types together.
This flexibility makes records incredibly powerful for storing real-world information where you naturally have different types of data about the same item (like a person's name, age, and whether they're enrolled).
Single records vs tables
- Single record: A one-dimensional structure containing different types of data about one item
- Table of records: A two-dimensional structure where each row is a complete record
Here's how records work in practice:
Worked Example: Record Structure and Access
rgbTable = [["khaki", 240, 230, 140],
["salmon", 250, 128, 114],
["coral", 255, 127, 80]]
Accessing record elements:
rgbTable[2]gets the entire "coral" record: ["coral", 255, 127, 80]rgbTable[1][0]gets just the colour name: "salmon"- Individual elements within any record using two indices for specific values
Why records are useful
Records let you store complete information about something in one place. For instance, a student record might contain their name (string), age (number), and whether they're present (boolean) - all different data types working together.
Key rules for accessing data structures
The Golden Rule: You need one index per dimension
- One-dimensional structures need one index:
myList[3] - Two-dimensional structures need two indices:
myTable[2][1]
This applies whether you're working with arrays (same data types) or records (mixed data types).
Real-world applications
Structured data types are everywhere in computing:
Real-World Applications:
Arrays in action:
- Storing pixel colours in images
- Temperature readings from sensors
- High scores in games
Records in action:
- Customer information in databases
- Student details in school systems
- Product catalogues in online shops
Understanding these structures helps you organise data efficiently and write better programmes.
Remember!
Key Points to Remember:
- Arrays contain elements of the same data type - all strings, all numbers, etc.
- Records can contain elements of different data types mixed together
- One index per dimension is the key rule for accessing any data structure
- One-dimensional structures are like lists, two-dimensional structures are like tables
- Both arrays and records are implemented as lists in Python, making them very practical to use