Community resourceWorksheet

1CP2-CT-3.7 Lists iteration and subprograms checkpoint

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

The checkpoint for the whole series, integrating lists, iteration and subprograms in one design.

Students will:

  • choose a suitable subprogram design for a stated requirement
  • trace an integrated algorithm through a function call
  • explain why a function generalises to data of a different length
  • diagnose an invalid index and give two valid repairs
  • write an integrated program and justify its use of parameters

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

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

Shared by Coding PathwayVerified teacher

  • 14 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.

Lists, iteration and subprograms checkpoint

This checkpoint retrieves the Y10-3 computational-thinking series. It contains concise method reminders but no new programming construct.

Use this decision sequence: choose the structure, choose how to visit its data, separate one responsibility, then decide whether the subprogram performs an action or returns a value.

1. Retrieve the model

  • A list is ordered and indexed from 0.
  • append, insert and del change a list.
  • range includes its start and excludes its stop.
  • for item in items visits each item.
  • A parameter is a placeholder; an argument is a supplied value.
  • A function returns a result; a procedure performs an action.
Fill in the blanks4 marks
To add at the end use gap 1. To visit every item use gap 2. A value in a call is an gap 3. A calculated value sent back is a gap 4.
  • append
  • argument
  • for
  • parameter
  • return value
  • while
Multiple choice1 mark

A subprogram must calculate a delivery cost so the main program can add tax. Which design is most suitable?

  • AA procedure that only prints the cost
  • BA function that returns the cost
  • CA list that deletes the cost
  • DA loop with no result

2. Trace an integrated algorithm

The function receives a list, iterates over every item and returns a total. Complete the trace table carefully. The call's result is printed after the loop has finished.

Trace table6 marks

Complete the trace table for the function call.

Follow the three list items in order and record how total changes before the return value is printed.

Use one row for each pass through the loop. Fill in a box only when that value changes on that row, and leave the rest blank.

ProgramPython
  1. def add_values(values):
  2. total = 0
  3. for value in values:
  4. total = total + value
  5. return total
  6. answer = add_values([3, 1, 4])
  7. print(answer)
Trace table with 6 columns
Rowvalues (add_values)total (add_values)value (add_values)answerReturn valueOutput
1
2
3
4
5
6
7
8
Written answer2 marks

Explain why answer becomes 8 and why the function can work with a list of a different length.

Link the accumulator to direct list iteration.

Students type their answer here.

3. Diagnose a boundary error

items = ["A", "B", "C"]
for index in range(0, len(items) + 1):
    print(items[index])

The loop eventually generates an invalid index. Diagnose it before proposing a repair.

Written answer4 marks

Identify the invalid index, explain why it is produced and give two valid repairs.

One repair may correct range; another may avoid indexes.

Students type their answer here.

4. Integrated programming task

Define a function count_above(values, limit) that returns how many items in values are greater than limit. Use a direct for loop. Then call it with [4, 9, 2, 11, 7] and 6, store the result in count, and print it.

The list and threshold are arguments, so the function must use its parameters rather than fixed values inside the definition.

Coding task5 marks
# Define count_above(values, limit), make the stated call, and print count.
Multiple choice1 mark

Which change best demonstrates separation of concerns?

  • APut input, calculation and output on one long line.
  • BRepeat the same loop in three places.
  • CReplace meaningful names with single letters.
  • DGive one subprogram the single job of calculating the count.
Written answer2 marks

Justify using parameters rather than fixed values inside count_above.

Link the design to generalisation and reuse.

Students type their answer here.

Route forward

You have consolidated the first use of lists, for, range, procedures and functions. Later series revisit two-dimensional structures, local/global scope, reverse traversal, testing and more demanding trace tables.