---
title: "Lists: Many Values Under One Name"
description: "Holding a whole collection of values in a single variable, then reading and changing items by their position."
canonical: https://lightmysky.com/learn/computing/lists-many-values-under-one-name-mt_ipB6kmyK85
source: https://lightmysky.com/learn/computing/lists-many-values-under-one-name-mt_ipB6kmyK85.md
retrieved: 2026-09-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# Lists: Many Values Under One Name

Holding a whole collection of values in a single variable, then reading and changing items by their position.

Subject: Computing · Area: Programming · Ages 15 to 16
Page: https://lightmysky.com/learn/computing/lists-many-values-under-one-name-mt_ipB6kmyK85

## Ready when they can

- Create a list and read an item by its index
- Add and remove items, and say how the positions shift
- Explain why one list beats twenty separate variables for the same data

## Lesson: Many values, one name

One variable can hold a whole row of values called a list. A list of rainbow colours holds red, orange, yellow, green, blue, indigo and violet under a single name. That beats juggling seven separate variables.

**Example.** Each slot has a seat number starting at 0. rainbowColours[0] gives red and rainbowColours[6] gives violet. Watch your seats, since off-by-one slips love list code.

You can rewrite any slot by its seat, so rainbowColours[4] = cyan swaps blue for cyan. To grow the end you append, like pushing Wash the dishes, Do laundry and Mow the lawn onto an empty chore list. New slots take the next free seats: 0, 1 and 2. Slipping one in earlier pushes every later slot one seat up.

**Tip.** Pick one list over twenty loose variables whenever the values belong together. One name, many values, zero clutter.

**Recap.** A list stores many values under one name, and you read, rewrite and grow slots by their seat numbers.

## Practice

8 questions on this page, each with its working shown.

## Needs first

- [Strings: Indexing, Slicing and Length](https://lightmysky.com/learn/computing/strings-indexing-slicing-and-length-mt_33hA050_Qz)

## Opens up

- [Binary Search on Sorted Data](https://lightmysky.com/learn/computing/binary-search-on-sorted-data-mt_3avV-VasFZ)
- [Stacks: Last In, First Out](https://lightmysky.com/learn/computing/stacks-last-in-first-out-mt_Evw7zeJE6Q)
- [Data as a Matrix: Rows, Features and the Target](https://lightmysky.com/learn/computing/data-as-a-matrix-rows-features-and-the-target-mt_KEN-TU1Gpn)
- [Traversing a List to Build a Result](https://lightmysky.com/learn/computing/traversing-a-list-to-build-a-result-mt_lusbjHFt95)
- [Dictionaries: Values Found by Key](https://lightmysky.com/learn/computing/dictionaries-values-found-by-key-mt_mofpj0n5AM)
