Two-dimensional arrays
About this lesson: Two-dimensional arrays
In short
A 2D array stores a table: scores[row, column]. Pick a cell.

What you'll explore
- 2D arrays: Rows and columns
- A 2D array stores a table: scores[row, column]. Pick a cell.
- Nested loops: Visit every cell
- An outer loop for rows and an inner loop for columns visit every cell. Show the row totals.
- 1D arrays recap: Visit every item
- A 1D array is a single row.
- Check yourself: Index
- grid is ARRAY[0:2, 0:4].
Also in this lesson
- Step by step
- Watch out for these
- More than the lesson
- Stretch your brain
- Try it yourself
Words to know
- 2D array
- A table of values with rows and columns.
- Row index
- Which row.
- Column index
- Which column.
- Nested loop
- A loop inside a loop.
Sources
- Python documentation: lists
- Raspberry Pi Foundation, Isaac Computer Science: 2D arrays
- BBC Bitesize, GCSE Computer Science: arrays
- Python FAQ: multidimensional lists