Arrays and indexes

About this lesson: Arrays and indexes

In short

An array stores a set of related values under one name. Each item has an index, starting at 0. Move the slider to read different items.

Arrays and indexes

What you'll explore

Index: Pick one item
An array stores a set of related values under one name. Each item has an index, starting at 0. Move the slider to read different items.
Loop over an array: Visit every item
A loop with an index can visit every item. Here it adds all the scores. Step through and watch i and total.
Why arrays?: One name instead of many
Compare five separate variables with one array. Which is easier to loop over and extend?
Check yourself: Index
colours = ["red", "green", "blue", "pink"]

Also in this lesson

  • Common mix-ups
  • Using arrays
  • Egg-box array

Words to know

array
A collection of values stored under one name.
index
The position number of an item, starting at 0.
element
One item in an array.
list
Python's name for an array.
len
A function giving the number of items.

Sources

  • BBC Bitesize KS3 Computer Science
  • Raspberry Pi Foundation, Computing curriculum resources

An interactive lesson with a live experiment: move the sliders, press the buttons and answer quick questions. 4 short steps and a 6-question quiz. Part of the Family plan. Written and checked by Shalo Lab. Last updated 11 November 2026.

← Data types · Working with strings →

All lessons in Term 1 · Computing · Age 13