Signed up recently but had issues with the confirmation email?

Click Forgot password and follow the reset steps. You can choose the same password you used when you signed up. This should then provide access.

Remember to check Spam and Junk. The email will be from auth@progressbytes.co.uk.

Revision notesQuestionsFor schools
Revise Computing
Log inStart revising free
Revision notesQuestionsFor schoolsLog in
GCSE Computer Science/Supplementary programming practice/Subprograms

Functions

301.12 Subprograms

Practise exam questions

Subprograms — Note 3 of 4

Return a value to program.

What you need to know

A function is a subprogram that calculates and returns a value using the return keyword. The returned value can be stored in a variable or used in an expression.

What to know

  • Uses return to send a value back
  • result = my_function() stores the returned value
  • Can return any type: int, str, bool, list
  • Function ends immediately when return is reached

Code examples

Function with return
python
def calculate_area(width, height):
    return width * height

area = calculate_area(5, 3)
print("Area: " + str(area))  # Area: 15
← Previous noteProcedures301.12 SubprogramsNext note →Scope + parameters301.12 Subprograms

Back to Subprograms

Specification notes for programming are in Paper 2.

Subprograms

Note 3 of 4

  1. 1Why subprograms
  2. 2Procedures
  3. 3Functions
  4. 4Scope + parameters
Topic overview

© 2026 Revise Computing · revisecomputing.co.uk

Worried about something?Question Bank UpdatesPrivacy noticeTermsContact

Revise Computing is an independent revision resource. It is not affiliated with, or endorsed by, OCR (Oxford Cambridge and RSA Examinations).