Skip to content
AgileLogics
Beginner 3 min read

Arrays

An array (sometimes called a list) is an ordered collection of values, stored under one variable name.

Real-world analogy: an array is like a numbered row of lockers — locker 0, locker 1, locker 2 — each holding one item, in a fixed order.

fruits = ["apple", "banana", "cherry"]
fruits[0]   # "apple" — most languages start counting at 0

Common mistakes

  • Forgetting that counting usually starts at 0, not 1 — the first item is at position 0.