Community resourceWorksheet

1CP2-CT-3.1 One-dimensional lists and indexing

Part 1 of 7 · 1CP2-CT-3 · Lists, iteration and subprograms

The opening list worksheet, establishing indexing and length before anything is changed or looped over.

Students will:

  • use the terms array, list and index correctly
  • read a value from a list by its index
  • predict the exact outputs of a short listing
  • create a list and use it in a program of their own
  • explain the runtime error an out-of-range index produces

Inside: 6 explanation cells, 3 multiple-choice questions, 1 Python task, 1 fill-in-the-blanks cell and 2 written answers. 15 marks, about 45 minutes.

Series: 1CP2-CT-3 · Lists, iteration and subprograms, part 1 of 7.

Shared by Coding PathwayVerified teacher

  • 13 cells
  • About 45 minutes
  • CC BY-SA 4.0
  • Shared 17 Aug 2026

Preview

The whole resource, exactly as a class sees it. Answers and marking are held back.

One-dimensional lists and indexing

A program often needs several related values. A one-dimensional data structure stores those values in one ordered line so one variable name can refer to the collection.

You already know that strings use positions. This worksheet transfers that idea to Python lists and distinguishes a list from an array.

1. Array, list and index

One-dimensional structures and indexesOne name, several ordered itemsCodingChessDramaMusicindex 0index 1index 2index 3The last valid positive index is always length minus one.

An array is an indexed structure whose size is normally fixed when it is created. Its items are normally the same data type. A Python list is also ordered and indexed, but it can grow or shrink and Python permits mixed types. In this course, Python lists provide the practical way to work with Pearson's one-dimensional array ideas.

Indexes begin at 0. For four items, valid positive indexes are 0 to 3. The expression len(clubs) is 4 and clubs[-1] is the final item.

Fill in the blanks3 marks
A one-dimensional structure stores items in an gap 1 sequence. Python's practical structure is a gap 2. The first positive index is gap 3, and the last is len(items) - 1.
  • 0
  • 1
  • fixed
  • list
  • ordered
  • random
Multiple choice1 mark

For levels = [3, 5, 7, 9], which expression reads the value 7?

  • Alevels[3]
  • Blevels(2)
  • Clevels[2]
  • Dlevels[-1]

2. Read a list without running it

Trace the indexes in this listing, then choose the exact output.

planets = ["Mercury", "Venus", "Earth", "Mars"]
print(planets[1])
print(planets[-1])
print(len(planets))
Multiple choice1 mark

Which option gives the exact three outputs in order?

  • A`Mercury`, `Mars`, `3`
  • B`Venus`, `Mars`, `4`
  • C`Venus`, `Earth`, `4`
  • D`Earth`, `Mars`, `4`
Written answer2 marks

Explain why planets[1] is Venus, and why len(planets) is not the final valid positive index.

Relate item number, zero-based index and length.

Students type their answer here.

3. Create and use a list

Create a list named temperatures containing 12, 15, 14 and 18 in that order. Store the second value in second and the final value in last, then print both on separate lines.

The brackets create one collection. Commas separate its items.

Coding task4 marks
# Create temperatures, read two positions and print them.

4. Boundaries and errors

For a list of length n, index n is outside the structure. It causes an IndexError at runtime. A valid but unintended index is instead a logic error because the program runs but uses the wrong item.

Written answer3 marks

colours = ["red", "green", "blue"] is followed by print(colours[len(colours)]). Explain the runtime error and give two valid expressions for the final item.

Use the relationship between length and the last index.

Students type their answer here.

Multiple choice1 mark

Which feature distinguishes a Python list from a typical fixed array?

  • AA list has no item order.
  • BA list cannot be indexed.
  • CA list stores only characters.
  • DA list can grow or shrink after creation.

Route forward

You can create a one-dimensional list and access its boundaries safely. Next you will change a list using the three methods named in Pearson's Programming Language Subset: append, insert and del.