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

Arrays in subprograms

301.17 Arrays and Records

Practise exam questions

Arrays and Records — Note 3 of 4

Pass list to functions.

What you need to know

You can pass a list to a function as a parameter. Functions can read, modify, or return new lists. Changes to the list inside the function affect the original.

What to know

  • Pass a list like any other parameter
  • The function receives a reference — changes affect the original
  • Return a new list if you don't want to modify the original
  • Common pattern: function takes a list and returns a result

Code examples

List as parameter
python
def find_highest(scores):
    highest = scores[0]
    for s in scores:
        if s > highest:
            highest = s
    return highest

marks = [72, 85, 91, 68]
print(find_highest(marks))  # 91
← Previous note2D arrays301.17 Arrays and RecordsNext note →Records301.17 Arrays and Records

Back to Arrays and Records

Specification notes for programming are in Paper 2.

Arrays and Records

Note 3 of 4

  1. 11D arrays
  2. 22D arrays
  3. 3Arrays in subprograms
  4. 4Records
Topic overview

© 2026 Revise Computing · revisecomputing.co.uk

Privacy noticeTermsContact

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