🧩Array
Also known as List
A row of values kept together under one name. Each sits in a numbered spot.
Think of it like
Think of it like an egg box. Each egg has its own spot, and the spots are in a row.
Example
A to-do app keeps Lucy's tasks in an array. Item 0 is buy milk, item 1 is call Jack.
Why it matters
Programs rarely deal with just one thing. Lists of users, songs and orders are all arrays.
Definition
Example code
python
>>> fruits = ["apple", "pear", "plum"]
>>> fruits[0]
'apple'
>>> len(fruits)
3Common mistake
Key takeaways
- 1In order. Items keep the order you put them in.
- 2Starts at zero. The first spot is number 0.
- 3One name, many values. A single variable holds the whole row.