Skip to content
AS & A Level 9618 · Paper 4

9618 Paper 4 Python

Paper 4 is a practical paper: programs that must print exactly what is asked. Work through the steps in order — each block links to the pseudocode guide with its Python column and the topic pages — and each step is checked against hidden tests as soon as you run it.

Your progress

0 of 90 steps done

90 steps in 16 blocks. Progress follows your account when you are signed in.

Start at Step 1
  1. A

    Block A · Python for Paper 4: data and I/O

    Inputs, outputs, the data types and the conversions Paper 4 expects you to get exactly right. Steps 1–5 of 90 · 9618 §11.1

    0 / 5 done

    1. 1Output a record
    2. 2INTEGER and REAL
    3. 3DIV and MOD
    4. 4STR_TO_NUM and LENGTH
    5. 5A BOOLEAN from Y/N
  2. B

    Block B · Selection and iteration

    IF, CASE, count-controlled, pre-condition and post-condition loops — written the Python way. Steps 6–11 of 90 · 9618 §11.2

    0 / 6 done

    1. 6Temperature bands
    2. 7Sum of squares
    3. 8Largest until zero
    4. 9REPEAT … UNTIL in Python
    5. 10A multiplication grid
    6. 11CASE OF with match
  3. C

    Block C · Strings and the built-in functions

    LEFT, RIGHT, MID, LENGTH, UCASE, LCASE, ASC and CHR — and their Python equivalents. Steps 12–17 of 90 · 9618 §11.1 · guide §5

    0 / 6 done

    1. 12LEFT, RIGHT and MID
    2. 13Count the vowels
    3. 14Reverse a string
    4. 15Caesar shift with ASC and CHR
    5. 16Palindrome
    6. 17Count the words
  4. D

    Block D · Procedures and functions

    PROCEDURE and FUNCTION in Python: parameters, RETURN, and what Python does instead of BYREF. Steps 18–23 of 90 · 9618 §11.3

    0 / 6 done

    1. 18FUNCTION Max3
    2. 19PROCEDURE DrawLine
    3. 20FUNCTION IsPrime
    4. 21Swap without BYREF
    5. 22FUNCTION GetMark
    6. 23A global counter
  5. E

    Block E · Arrays as lists

    1D and 2D arrays as Python lists: fill, total, search, find the largest and bubble sort. Steps 24–30 of 90 · 9618 §10.1–10.2

    0 / 7 done

    1. 24Fill an array
    2. 25Linear search
    3. 26Bubble sort with a flag
    4. 27A 2D array: row totals
    5. 28Largest and where it is
    6. 29Frequency count
    7. 30Remove duplicates
  6. F

    Block F · Records

    A TYPE … ENDTYPE record as a Python class, and arrays of records. Steps 31–35 of 90 · 9618 §10.1

    0 / 5 done

    1. 31A record class
    2. 32An array of records
    3. 33Search an array of records
    4. 34Sort records by a field
    5. 35Totals from records
  7. G

    Block G · Text files

    OPENFILE, READFILE, WRITEFILE and EOF in Python, line by line. Steps 36–40 of 90 · 9618 §10.3

    0 / 5 done

    1. 36Write lines to a file
    2. 37Append and read back
    3. 38Read until the end of file
    4. 39Records in a file
    5. 40Copy only matching lines
  8. H

    Block H · Exception handling

    try … except … finally around input, files and arithmetic. Steps 41–44 of 90 · 9618 §20.3

    0 / 4 done

    1. 41Catch a ValueError
    2. 42Re-ask until a whole number
    3. 43A missing file
    4. 44finally always runs
  9. I

    Block I · Binary search and insertion sort

    The A2 standard algorithms, written exactly the way the mark scheme wants. Steps 45–49 of 90 · 9618 §19.1

    0 / 5 done

    1. 45Iterative binary search
    2. 46Binary search as a function
    3. 47Insertion sort
    4. 48Insertion sort descending
    5. 49Sort, then search
  10. J

    Block J · Recursion

    Base case, general case and unwinding — factorial to binary search. Steps 50–55 of 90 · 9618 §19.2

    0 / 6 done

    1. 50Recursive factorial
    2. 51Recursive Fibonacci
    3. 52Sum of digits
    4. 53Recursive power
    5. 54Recursive binary search
    6. 55Count down recursively
  11. K

    Block K · Stacks and queues

    An array-based stack and linear and circular queues with the pointers the mark scheme gives marks for. Steps 56–62 of 90 · 9618 §10.4 · §19.1

    0 / 7 done

    1. 56Push and pop
    2. 57Stack full and empty
    3. 58Reverse with a stack
    4. 59Linear queue
    5. 60Circular queue
    6. 61Peek and size
    7. 62Check brackets with a stack
  12. L

    Block L · Linked lists

    Nodes in arrays with a start pointer and a free list, -1 as the null pointer. Steps 63–68 of 90 · 9618 §19.1

    0 / 6 done

    1. 63Output a linked list
    2. 64Insert at the front
    3. 65Insert in order
    4. 66Find a value
    5. 67Delete a node
    6. 68The free list
  13. M

    Block M · Binary trees

    A binary search tree: insert, search, the three traversals, height and leaves. Steps 69–74 of 90 · 9618 §19.1

    0 / 6 done

    1. 69Insert into a tree
    2. 70In-order traversal
    3. 71Pre-order and post-order
    4. 72Search the tree
    5. 73Height of the tree
    6. 74Count the leaves
  14. N

    Block N · Classes and objects

    Classes, constructors, private attributes, getters and setters. Steps 75–80 of 90 · 9618 §20.1

    0 / 6 done

    1. 75A class with a constructor
    2. 76Private attributes and getters
    3. 77Setters that validate
    4. 78An array of objects
    5. 79A method that calculates
    6. 80Objects from a file
  15. O

    Block O · Inheritance and polymorphism

    Subclasses, super().__init__, overriding and containment. Steps 81–85 of 90 · 9618 §20.1

    0 / 5 done

    1. 81A subclass
    2. 82Call the parent constructor
    3. 83Override a method
    4. 84Polymorphism in a loop
    5. 85Containment
  16. P

    Block P · Full Paper 4 tasks

    Several requirements in one program, in the order a Paper 4 question builds them. Steps 86–90 of 90 · 9618 Paper 4

    0 / 5 done

    1. 86Task: high-score table
    2. 87Task: library loans
    3. 88Task: stack calculator
    4. 89Task: delivery queue
    5. 90Task: shop classes
Enroll nowOnline classes