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,insertanddelchange a list.rangeincludes its start and excludes its stop.for item in itemsvisits each item.- A parameter is a placeholder; an argument is a supplied value.
- A function returns a result; a procedure performs an action.
- append
- argument
- for
- parameter
- return value
- while
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.
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.
def add_values(values):total = 0for value in values:total = total + valuereturn totalanswer = add_values([3, 1, 4])print(answer)
| Row | values (add_values) | total (add_values) | value (add_values) | answer | Return value | Output |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | ||||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 | ||||||
| 8 |
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.
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.
# Define count_above(values, limit), make the stated call, and print count.
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.
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.