Community
Community resources
Computer science Worksheets and Python Workspaces shared by Coding Pathway teachers. Worksheets cover exam board theory as well as programming. Read any of them in full here. Teachers can copy one into their own lessons and edit it before setting it to a class.
Planning a whole course or unit? Our mapped pages put the teaching sequence in order with the Worksheets that cover it: OCR GCSE Computer Science (J277), Pearson Edexcel GCSE Computer Science (1CP2), OCR A Level Computer Science (H446), Python Turtle for Key Stage 3.
- 438 resources
- 3 teachers sharing
- Creative Commons licensed
Trace tables Worksheets
9 resources match. Newest first. Opening a resource shows the whole thing, with answers and marking held back.
H446 2.3.1 · Algorithms
Includes OCR H446 2.3.1 Linear and binary search
Binary search is examined in H446 2.3.1 alongside linear search, and the mark is usually lost on the precondition or on bounds that drift during a trace. This worksheet has students search by hand, trace the shrinking bounds, write both algorithms in Python and then pick the right one for a stated situation. Students will: - state the precondition that makes discarding half a list safe - trace low, high and middle values while a search narrows towards a target - record every compared value when searching the same data both ways - implement linear and binary search that return an index or minus one - recommend a search for a short one-off list and for a large maintained catalogue Inside: 5 explanation cells, 1 multiple-choice question, 1 fill-in-the-blanks cell, 2 written answers, 1 Python task and 1 trace table. 25 marks, about 25 to 40 minutes. Series: H446 2.3.1 · Algorithms, part 5 of 16.
WorksheetOCR H446 2.2.1 Recursive functions
Part 3 · H446 2.2.1 · Programming techniques
Recursion is examined in H446 2.2.1 as a tracing skill and a construction skill at once. This worksheet separates the two directions of a recursive call, the descent into smaller problems and the unwinding of returned values, so students can explain why a function terminates rather than only recognise the pattern. Students will: - distinguish the base case from the recursive case in a supplied function - trace recursive calls alongside the values returned as they unwind - explain termination and the order in which results are combined - write a recursive digit sum using remainder and integer division - repair a recursion that never reaches a base case and justify the repair Inside: 6 explanation cells, 2 multiple-choice questions, 1 fill-in-the-blanks cell, 2 written answers, 1 Python task and 1 trace table. 18 marks, about 25 to 35 minutes. Series: H446 2.2.1 · Programming techniques, part 3 of 14.
WorksheetOCR H446 2.1.4 Decisions, logical conditions and flow
Part 1 · H446 2.1.4 · Thinking logically
OCR H446 2.1.4 is about decisions that change the route through a solution, and about the boundary values where those decisions quietly go wrong. A community makerspace access policy gives students conditions to write, trace, repair and then extend. Students will: - identify a genuine decision point and the condition that controls it - write a Boolean condition combining membership, training and an age threshold - repair a comparison operator that fails only at the boundary value - trace nested decisions and explain why one route is never reached - implement the access routes in Python and extend the rule with an alternative condition Inside: 7 explanation cells, 1 multiple-choice question, 1 fill-in-the-blanks cell, 3 written answers, 1 Python task and 1 trace table. 19 marks, about 25 to 35 minutes. Series: H446 2.1.4 · Thinking logically, part 1 of 1.
WorksheetOCR H446 2.1.3 Procedural order and sub-procedures
Part 2 · H446 2.1.3 · Thinking procedurally
Correct components in the wrong order still produce an incorrect solution, which is the reasoning OCR H446 2.1.3 examines here. A digital escape-room booking workflow drives the ordering work, supported by a trace table, a Python admission function and a pseudocode design task. Students will: - order sub-procedures using data dependencies, preconditions and state changes - explain why validation must come before any change to stored capacity - trace a workflow and record which route reaches confirmation - implement an ordered admission function that leaves external state unchanged - design pseudocode from named sub-procedures showing parameters and returned values Inside: 7 explanation cells, 1 multiple-choice question, 2 fill-in-the-blanks cells, 2 written answers, 1 Python task and 1 trace table. 22 marks, about 25 to 35 minutes. Series: H446 2.1.3 · Thinking procedurally, part 2 of 2.
WorksheetSeries · 3 partsH446 1.4.2 · Data structures
Includes OCR H446 1.4.2 Stacks: behaviour and operations
Stacks are examined in H446 1.4.2 as state, not just as a definition, so this worksheet fixes an explicit top-pointer convention and holds students to it. Push, pop and peek are traced on an array stack with a next-free-space pointer, so returned values, overflow and underflow are all decided by pointer state rather than by leftover array contents. Students will: - apply push, pop and peek under a stated next-free-space pointer convention - record the array contents, top pointer and returned value after each operation - detect overflow and underflow instead of reading a slot that is no longer part of the stack - implement a pop function that reports underflow rather than failing - explain why last in, first out suits nested calls and undo better than a first in, first out queue Inside: 7 explanation cells, 2 multiple-choice questions, 2 fill-in-the-blanks cells, 1 written answer, 1 Python task and 1 trace table. 18 marks, about 45 to 55 minutes. Series: H446 1.4.2 · Data structures, part 3 of 14.
Worksheet1CP2-CT-2.6 Understanding condition-controlled while loops
Part 6 · 1CP2-CT-2 · Selection, strings and while loops
The reading worksheet for condition-controlled loops, taken one complete pass at a time before any are written. Students will: - identify the three parts every while loop needs - trace a loop pass by pass and state every output - say when a pre-condition loop executes zero times - diagnose a non-terminating loop and give the fixing line - predict the final output of a loop from its listing Inside: 7 explanation cells, 3 multiple-choice questions, 2 fill-in-the-blanks cells and 3 written answers. 17 marks, about 45 minutes. Series: 1CP2-CT-2 · Selection, strings and while loops, part 6 of 8.
Worksheet1CP2-CT-4.5 Linear search in one dimension
Part 5 · 1CP2-CT-4 · Structures, validation and search
The search worksheet, maintaining the three pieces of state a linear search needs and stopping correctly. Students will: - count the comparisons a search makes - trace a linear search to its termination - explain why both loop conditions are needed - write a complete search of their own - preserve a correct not-found outcome Inside: 6 explanation cells, 2 multiple-choice questions, 1 Python task, 1 trace table, 1 fill-in-the-blanks cell and 2 written answers. 14 marks, about 45 minutes. Series: 1CP2-CT-4 · Structures, validation and search, part 5 of 7.
Worksheet1CP2-CT-3.4 Iterating through a list
Part 4 · 1CP2-CT-3 · Lists, iteration and subprograms
The list iteration worksheet, visiting items one at a time and tracing the state that changes as the loop runs. Students will: - say how many times a loop over a list repeats - complete a trace table for a loop that accumulates a value - explain why accumulated outputs differ from the raw items - process only the items that meet a condition - compare iterating by item with iterating by index Inside: 6 explanation cells, 2 multiple-choice questions, 1 Python task, 1 trace table, 1 fill-in-the-blanks cell and 2 written answers. 14 marks, about 45 minutes. Series: 1CP2-CT-3 · Lists, iteration and subprograms, part 4 of 7.
WorksheetSeries · 2 partsJ277 2.1.2 · Tracing and refining algorithms
Includes J277 2.1.2 Trace tables: sequence and selection
Trace tables for sequence and selection, marked automatically row by row. Students will: - record variable and output changes in execution order - decide when a trace-table box should be left empty - trace a program containing a decision - use a completed trace to explain what a program produces - apply the method to an exam-style question Inside: 3 explanation cells, 3 trace tables, 2 multiple-choice questions and 2 written answers. 6 author-set marks plus the trace-table rows, about 45 minutes. Series: J277 2.1.2 · Tracing and refining algorithms, part 2 of 3.