Choose exam board for KS4 Computer Science (GCSE)
Choose exam board for KS4 English
Choose exam board for KS4 French
Choose exam board for KS4 Geography
Choose exam board for KS4 German
Choose exam board for KS4 History
Choose tier for KS4 Maths
Choose exam board for KS4 Music
Choose exam board for KS4 Physical education (GCSE)
Choose exam board for KS4 Religious education (GCSE)
Choose exam board for KS4 Spanish

      Lesson details

      Learning outcome

      I can create and call a procedure in a program.

      Key learning points

      1. A procedure is a named block of code that performs a specific task.
      2. Procedures are designed to run a sequence of code that does not return any value to the calling program.
      3. In order to run a procedure, it must be called by the main program.

      Keywords

      • Call - an expression that passes control and arguments (if any) to a subprogram

      • Procedure - a subprogram that executes a block of code when called but does not return a value

      • Function - a subprogram that returns a value

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

      Common misconception

      Functions and procedures are just different names for the same thing.

      A function is a type of subprogram that returns a value whereas a procedure is a type of subprogram that does not return a value.

      Teacher tip

      print() is an example of a procedure whereas input() is an example of a function. Ask pupils to explain why.

      Equipment

      Pupils will need access to a device that can edit and run Python programs. Examples in this lesson use the RPF Code Editor https://oak.link/python-editor

      Licence

      This content is © Oak National Academy Limited (2026), 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

      6 Questions

      Q1.
      What is the term used for the name of a subprogram?

      Correct answer: identifier
      variable
      parameter
      interface

      Q2.
      In this code:
      1
      def num_walks(total_dogs, total_days):
      total_dogs and total_days are:
      Code colour

      identifers
      variables
      Correct answer: parameters
      return values

      Q3.
      A chart is created to decide the hierarchy for a program.

      Correct Answer: structure

      Q4.
      A subprogram interface is made up of which items?

      Correct answer: identifier
      Correct answer: parameters
      variables
      Correct answer: return values
      boundaries

      Q5.
      Select the statement that is true.

      If a subprogram is defined, then it must be executed in the program.
      Subprograms are always designed to perform multiple tasks.
      Correct answer: Subprograms make programs easier to read and understand.

      Q6.
      What code is missing from the program?
      123456
      ___ multiply_two_numbers(number1, number2) answer = number1 * number2 return answer result = multiply_two_numbers(5,5) print(result)
      Code colour

      Correct Answer: def

      5 Questions

      Q1.
      Match the term to the definition.

      Correct Answer:parameter,used in a subprogram to allow values to be passed into it

      used in a subprogram to allow values to be passed into it

      Correct Answer:function,a subprogram that returns a value

      a subprogram that returns a value

      Correct Answer:procedure,a subprogram that does not return a value

      a subprogram that does not return a value

      Correct Answer:subprogram,a sequence of instructions to perform a specific task

      a sequence of instructions to perform a specific task

      Q2.
      are used in subprogram to allow values to be passed into them.

      Correct Answer: parameters, arameters

      Q3.
      are the values held in the brackets of a subprogram call.

      Correct Answer: arguments, rguments

      Q4.
      This code is an example of:
      12345
      def calculate(a, b): answer = a + b return answer answer = calculate(5, 10)
      Code colour

      a procedure
      Correct answer: a function
      iteration
      selection

      Q5.
      What keyword is used to define a subprogram in Python?

      Correct answer: def
      sub
      input
      print

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