GCSE Python exam-style questions: how to approach them

This unit is guidance rather than teaching: it walks through how UK GCSE Computer Science Python exam questions are structured, how mark schemes typically award marks, and the common traps that lose easy marks (using / when // is required, forgetting to cast input(), off-by-one range errors, and printing when you should be returning). It applies to all UK exam boards (OCR J277, AQA 8525, Pearson Edexcel, Eduqas and WJEC) and is written to complement — not replace — your board's past papers. Perfect for GCSE and A Level revision and independent or home-schooled learners preparing for exams.


What you'll learn

  • Read the question twice: identify what output is expected and in what form
  • Plan on paper before coding — decompose into steps
  • Cast input() to int() or float() when doing arithmetic
  • Use // for integer division and % for remainder when the answer must be a whole number
  • Match variable names to the question wording where possible
  • For 'write a function' questions, use return, not print
  • Test with the sample inputs the question gives you

UK GCSE topic coverage

  • Selection & validation
  • Functions & iteration
  • Arrays & validation
  • Strings
  • Arrays & iteration
  • Files, functions & 2D arrays
  • Selection & functions
  • Programming fundamentals
  • Iteration & random
  • Subroutines, files & 2D arrays
  • Iteration
  • Selection & iteration
  • 2D arrays & iteration
  • Strings, selection & iteration
  • Lists, selection & files
  • Functions, 2D lists & modules
  • Arithmetic, boolean logic & validation
  • File handling & string parsing
  • List algorithms & composite loops

Worked example

Anatomy of a typical exam-style function answer

def average(scores):
    total = 0
    for s in scores:
        total = total + s
    return total / len(scores)

print(average([10, 20, 30]))

Try the exam questions free with a RunPy account

Sign up free and get a selection of these exam-style questions with the full marking flow, plus every lesson in Unit 1 (Input, Output and Variables) to warm up. No card required.


Lessons in this unit

Full interactive lessons with checked tasks are available to signed-in RunPy users. A selection of the questions below is free with a RunPy account.

  1. VaultLock Security (strings & selection)
  2. Soundwave Festival (functions)
  3. Sports Day (mixed)
  4. Pixel Chat (strings)
  5. Word Search Tool (arrays)
  6. SkyCourier (files, 2D arrays & pay)
  7. Game Levels (selection & functions)
  8. Mini Calculator (arithmetic)
  9. Brain Trainer (random & loops)
  10. Sentinel Security (subroutines & 2D arrays)
  11. Arcade Scoreboard (variables & selection)
  12. Class Test Results (loops)
  13. Harbour Hotel Car Park (selection & iteration)
  14. GridBlocks (2D grids)
  15. Science Lab Log (while loops)
  16. The Beanery Café (till program)
  17. Westfield Library (lists & files)
  18. Summit Peak Weather Station (functions & 2D lists)
  19. SwimStar Leisure Centre (arithmetic & validation)
  20. Rocket Bakery (reading files)
  21. Starfall Quiz Night (searching & scores)

Frequently asked questions

Which UK exam boards is this relevant to?
All of them: OCR J277, AQA 8525, Pearson Edexcel, Eduqas and WJEC GCSE Computer Science, plus the Python portions of most A Level Computer Science specifications.
Should I use a for loop or a while loop in exam answers?
Match the question. If it says 'for a known number of times' or gives a fixed count, use for. If it says 'until' or the number depends on input, use while.
Do the mark schemes accept pseudocode?
It depends on the board and the question. Some questions ask specifically for Python, others accept pseudocode or 'a high-level language'. Read the wording of each question carefully.