Revise Computing
Revision notesQuestionsFor schools
Log inStart revising free
Revision notesQuestionsFor schoolsLog in
GCSE Computer Science/Supplementary programming practice/Arrays and Records

2D arrays

301.17 Arrays and Records

Practise exam questions

Arrays and Records — Note 2 of 4

Table structure rows/cols.

What you need to know

A 2D array is a list of lists, representing rows and columns like a table. Access elements with two indices: grid[row][col].

What to know

  • A list of lists: grid = [[1,2],[3,4],[5,6]]
  • grid[0] is the first row
  • grid[0][1] is row 0, column 1
  • Use nested for loops to process all elements

Code examples

2D array
python
grid = [
    [1, 2, 3],
    [4, 5, 6]
]
print(grid[0][2])  # 3 (row 0, col 2)

for row in grid:
    for item in row:
        print(item, end=" ")
    print()
← Previous note1D arrays301.17 Arrays and RecordsNext note →Arrays in subprograms301.17 Arrays and Records

Back to Arrays and Records

Specification notes for programming are in Paper 2.

Arrays and Records

Note 2 of 4

  1. 11D arrays
  2. 22D arrays
  3. 3Arrays in subprograms
  4. 4Records
Topic overview

© 2026 Revise Computing · revisecomputing.co.uk

Privacy noticeTermsContact

Revise Computing is an independent revision resource. It is not affiliated with, or endorsed by, OCR (Oxford Cambridge and RSA Examinations).