Signed up recently but had issues with the confirmation email?
Click Forgot password and follow the reset steps. You can choose the same password you used when you signed up. This should then provide access.
Remember to check Spam and Junk. The email will be from auth@progressbytes.co.uk.
Arrays (of up to 3 dimensions), records, lists, tuples
1.4.2 Data Structures
Practise exam questionsData Structures — Note 1 of 3
Candidates should be able to describe what is meant by arrays (up to 3 dimensions), records, lists and tuples. They are expected to be able recognise when they can be used and incorporate them in their programs to store data
Data structures organise related data so it can be processed efficiently. Arrays hold a fixed number of items of the same type; records group related fields of different types; lists are dynamic; tuples are fixed and cannot be changed.
board[row, col]); a 3D array adds a third index, e.g. sales[shop, month, product].grid = [[0] * 3 for _ in range(3)] # 2D array (3 x 3)
grid[1][2] = 5
student = {"name": "Sam", "age": 17, "enrolled": True} # record
scores = [12, 7, 9] # list (dynamic)
scores.append(15)
origin = (0, 0) # tuple (immutable)
# origin[0] = 5 would cause an errorA static (fixed size) data structure holding items of the same data type, accessed by index. OCR arrays are zero-indexed.
A data structure that groups related fields, which can have different data types, e.g. a student record with name (string), age (integer) and enrolled (Boolean).
A dynamic data structure whose size can change as items are added or removed; items can be of different types in languages like Python.
An ordered collection of items that is IMMUTABLE: once created, its items cannot be changed, added or removed.
array board[3,4], not just board = [], which loses marks. Set a record's fields by name, with quotes round strings only: student.name = "Sam" but student.age = 17.Past exam questions
Ready to test yourself?
Practise 1.4.2 questions