CGP, PG Online, and more
Amazon amazon.co.uk
Python Books
Beginner to advanced Python
Amazon amazon.co.uk
Raspberry Pi Kits
For programming projects
Amazon amazon.co.uk
Fastmail — Private Email
Privacy-first email with no ads and no tracking
fastmail.com
Dynadot — Domain Registration →
Register or transfer domains with free SSL and affordable pricing
dynadot.com
Zen Internet — UK Broadband →
Award-winning UK broadband with no data caps and great customer service
zen.co.uk
CS Revision Guides

Programming Fundamentals

Year 1 / ASYear 2 / A-Level All Boards (AQA, Edexcel, OCR, WJEC, CCEA) AQA

A-Level Computer Science revision: Programming Fundamentals. Learning objectives, key points, worked examples and practice questions across AQA, Edexcel, OCR, WJEC and CCEA.

Fastmail

📌 Key Points

Key Fact: Data types: int, float, bool, char, string; type casting; constants vs variables
Key Fact: Selection: if/elif/else, switch/case (match in Python 3.10+); nested conditions
Key Fact: Iteration: for (definite), while (indefinite), do-while (at least once); break/continue
Key Fact: Functions: definition, call, parameters (positional, keyword, default), return, recursion
Key Fact: Scope: local, global, nonlocal; shadowing; modules and imports
Key Fact: String: len, index, slice, split, join, replace, format, f-strings, regex basics
Key Fact: File: open/close, read/write modes, with statement, try/except/else/finally

🎯 Learning Objectives

  • Use variables, constants, and data types (integer, real, boolean, character, string)
  • Implement control structures: sequence, selection (if/else, switch), iteration (for, while, do-while)
  • Design and use functions/procedures: parameters (value/reference), return values, scope
  • Handle input/output: file I/O, exceptions, validation
  • Apply string manipulation: concatenation, slicing, searching, formatting
  • Use random number generation and libraries

💡 Worked Example

Exam-Style Question

Question: Write a function that reads a file of integers and returns the median

Model Answer:

def median_from_file(filename): with open(filename) as f: nums = sorted(int(line.strip()) for line in f if line.strip()) n = len(nums) if n == 0: return None mid = n // 2 return nums[mid] if n % 2 else (nums[mid-1] + nums[mid]) / 2

❓ Practice Questions

Questions:

  • Write a program that validates email format using regex
  • Implement a recursive factorial function
  • Create a menu-driven calculator with functions
  • Write a function to count word frequencies in a text file
  • Handle division by zero with try/except

🎬 Video Resources

📄 Past Papers & Exam Resources

🔗 Further Reading & Resources