New
New
Year 10
AQA

Functions

I can create a program that uses a function to return values.

New
New
Year 10
AQA

Functions

I can create a program that uses a function to return values.

These resources will be removed by end of Summer Term 2025.

Switch to our new teaching resources now - designed by teachers and leading subject experts, and tested in classrooms.

These resources were created for remote use during the pandemic and are not designed for classroom teaching.

Lesson details

Key learning points

  1. A function is a named block of code that is called to perform a task and will return a value.
  2. A return value is a value that is returned to the calling program.
  3. Arguments are values provided to a subroutine at the time it is called.
  4. Subroutine parameters are values used by the subroutine that are passed from the arguments when it is called.

Keywords

  • Function - a subroutine that returns a value

  • Return value - a value that is returned by a function

  • Parameter - used in a subroutine to allow values to be passed into them

  • Argument - values held in the brackets of a subroutine call, which are passed into a subroutine via the parameters

Common misconception

When a function returns a value it can be used throughout the program that called it.

The return value needs to be stored if it is to be used later in the program that calls it. If it isn't stored, the value cannot be used again.


To help you plan your year 10 computer science lesson on: Functions, download all teaching resources for free and adapt to suit your pupils' needs...

Draw parallels to functions that pupils have already used such as input(). If the text entered is not stored in a varibale, it cannot be used. Ask pupils to suggest other such examples.
Teacher tip

Equipment

Licence

This content is © Oak National Academy Limited (2025), licensed on Open Government Licence version 3.0 except where otherwise stated. See Oak's terms & conditions (Collection 2).

Lesson video

Loading...

Prior knowledge starter quiz

Download quiz pdf

6 Questions

Q1.
A is a section of code that performs a specific task.
Correct Answer: subroutine, procedure, function
Q2.
What is the correct syntax for defining a procedure in Python?
procedure my_procedure():
Correct answer: `def my_procedure():`
sub my_procedure():
Q3.
What is the difference between a procedure and a function?
There is no difference.
A procedure returns a value, a function does not.
Correct answer: A function returns a value, a procedure does not.
Q4.
Match the terms to the definitions.
Correct Answer:procedure,a subroutine that executes a block but does not return a value

a subroutine that executes a block but does not return a value

Correct Answer:function,a subroutine that returns a value

a subroutine that returns a value

Correct Answer:return value,a value that is returned by a function

a value that is returned by a function

Correct Answer:call,an expression that passes control and arguments to a subroutine

an expression that passes control and arguments to a subroutine

Q5.
The values passed to a procedure when it is called are called .
Correct Answer: Arguments, rguments
Q6.
The variables defined inside a procedure are called .
Correct Answer: parameters, arameters

Assessment exit quiz

Download quiz pdf

6 Questions

Q1.
What is the primary purpose of a function in programming?
to repeat a block of code multiple times
to store and retrieve data
to organise code
Correct answer: to perform a specific task and return a value
Q2.
Which keyword is used to define a function in Python?
func
function
Correct answer: `def`
define
Q3.
What are the values passed to a function called?
parameters
variables
Correct answer: arguments
constants
Q4.
Match the following terms and definitions.
Correct Answer:function,a named block of code that performs a task and returns a value

a named block of code that performs a task and returns a value

Correct Answer:parameters,values used by the function that are passed to it when it is called

values used by the function that are passed to it when it is called

Correct Answer:return value,a value that is returned by a function

a value that is returned by a function

Correct Answer:arguments,values provided to a function at the time it is called

values provided to a function at the time it is called

Q5.
A function can have __________ parameters.
only one
Correct answer: zero, one or more
no
Q6.
The keyword used to send a value back from a function is .
Correct Answer: return