A variable holds one value. A list holds many, in order, under a single name — every score in a game, every name in a class. On List Lane, Year 4 coders find items by position and change lists step by step.
What your child will learn
- Know that a list stores many items in order under one name
- Find an item by its position, and say how long a list is
- Add, delete, insert and replace items
- Understand that a loop can do something to every item in a list
Position matters
Each item has a position. In these quests, as in Scratch, the first item is item 1. Many text languages count from 0 instead — a famous source of bugs, and worth knowing about.
Lists and loops
Lists and loops are best friends. “For each item in the list, say the item” works whether the list has three items or three thousand. That is why programmers reach for a list instead of lots of separate variables.
Example questions
Here are a few questions like the ones in the first quest. Can you solve them?
1. What is a list in coding?
- A single number
- A broken program
- A kind of loop
- A group of items stored in order under one name
Show answer
Answer: A group of items stored in order under one name. A list keeps many values together, in order.
2. A list holds: sun, moon, star. Which item is “moon”?
- Item 3
- Item 1
- Item 2
- Item 4
Show answer
Answer: Item 2. Moon is second in the list.
3. A list holds: red, blue, green, pink. How long is the list?
- 1
- 5
- 4
- 3
Show answer
Answer: 4. There are four items, so its length is 4.
Tips for grown-ups
- Write a real list — shopping, favourite films — and number the items.
- Play “list commands”: add to the end, delete item 2, insert at position 1.
- In Scratch, make a list and try the add, delete and insert blocks.