Revise Computingrevisecomputing.co.uk
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates

Knowledge organisers / Subprograms

Procedures

All topicsPractise exam questions
Knowledge organiser

Subprograms

301.12b

Reusable code without return.

What you need to know

A procedure is a subprogram that performs an action but does not return a value. In Python, it is defined with def and has no return statement (or returns None).

Key points

  • Defined with def name():
  • Performs an action (e.g. prints something)
  • Does not return a value
  • Call it by name: greet("Alice")

Code examples

Procedure
python
def greet(name):
    print("Hello, " + name + "!")
    print("Welcome to the quiz.")

greet("Alice")
greet("Bob")