AQA Computer Science GCSE
Programming Concepts – Arrays and Records
Arrays are an example of a data structure. They are a way of storing more than one item of data in a single variable.
In Python they are implemented using lists.
NB: Array indexing almost always starts from 0.
Records are the other data structure you need to know about. The problem is that these aren't supported directly by Python.
Think about records as the same sort of thing as a record in a database...
How to fake Records in Python – **COMPLEX**
Here's a code file you should be able to copy and paste into IDLE to see how records work.
You can get arrays of anything - strings, integers, Booleans, mixed values. Or arrays of arrays.
An array of arrays can be really powerful as a way if organising data. We call arrays of arrays two-dimensional arrays.
2-D arrays can be tricky. The exam board likes using them in complex questions towards the end of the exam paper. There are good reasons for this.
There are two code files to take a look at. Try to look at the code first before you run it.
Test scores 2D arrays example – complex
If you need somewhere to run code at home, try this online Python IDE.