Community resourceWorksheet
1CP2-CT-3.6 Functions and return values
Part 6 of 7 · 1CP2-CT-3 · Lists, iteration and subprograms
The function worksheet, and the distinction between returning a value and printing one.
Students will:
- follow a returned value through the program that called it
- use a returned value in more than one way
- complete a function that performs a pure calculation
- explain why return suits a calculation better than print
- state what happens when a return statement is reached
Inside: 7 explanation cells, 3 multiple-choice questions, 2 Python tasks, 1 fill-in-the-blanks cell and 2 written answers. 19 marks, about 45 minutes.
Series: 1CP2-CT-3 · Lists, iteration and subprograms, part 6 of 7.
Shared by Coding PathwayVerified teacher
- 15 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.
Functions and return values
A function is a subprogram designed to calculate and return a value. The calling program can store that value, combine it in an expression or pass it elsewhere.
A procedure performs an action. A function supplies a result. Python defines both with def, so their intended use and the presence of return make the distinction clear.
1. Follow a returned value
def rectangle_area(width, height):
area = width * height
return area
wall_area = rectangle_area(4, 3)
print(wall_area)
The arguments 4 and 3 enter through the parameters. return area sends 12 back to the call. The assignment captures it in wall_area. Code after an executed return in that call is not reached.
- arguments
- outputs
- parameters
- return value
- variables
2. Predict how a call is used
Read this code without executing it.
def add_fee(cost):
return cost + 2
first = add_fee(5)
print(first)
print(add_fee(8))
Which option gives the exact output?
- A`5` then `8`
- B`7` then `10`
- C`7` then `8`
- D`None` then `None`
Explain the two different ways the returned value is used in the listing.
Compare the assignment to `first` with the second print call.
Students type their answer here.
3. Complete a pure calculation
Define to_minutes(hours) so it returns the number of minutes in the supplied hours. Call it with 2, store the returned value in minutes, then print minutes.
The function should not print internally. Returning keeps the calculation reusable in other expressions.
# Define to_minutes(hours), capture the result for 2 hours, and print it.
4. Return is not print
print(result) displays a value but does not normally give it back for later calculation. return result ends the function call and supplies the value to the caller. A program may print a returned value later, but these are two separate operations.
Why is return total more suitable than print(total) inside a calculation function?
- AReturn makes the value available to the calling code.
- BReturn displays the value in a larger font.
- CReturn repeats the function automatically.
- DReturn changes every parameter into a constant.
5. Independent function
Define mean_of_three(a, b, c) so it returns the arithmetic mean of its three arguments. Call it with 6, 9 and 12, store the result in average, and print it.
Add the three values before dividing by 3. The expected result is 9.0.
# Define mean_of_three, capture the requested call, and print it.
Compare a procedure that prints a converted measurement with a function that returns it. Explain one advantage of returning the value.
Consider what the calling program can do next.
Students type their answer here.
What happens when an executed return statement is reached?
- AThe whole Python program always closes.
- BThe current function call ends and a value is sent back.
- CThe function begins again with the same arguments.
- DEvery local name becomes global.
Route forward
You can choose between an action-focused procedure and a value-returning function. The checkpoint combines lists, iteration and subprogram design without introducing scope, which Pearson revisits later.