Help pupils practise Python debugging and code tracing with 30 structured activities for KS3 and GCSE Computer Science. Includes printable worksheets, trace tables, optional hints, worked answers and Python files.
Created by Pixel & Python, this pack is designed for Years 9 and 10 pupils who have already encountered basic Python programming. It provides focused practice in reading code, identifying errors, explaining corrections and checking results.
A confused snack machine, an unstoppable robot and a ticket desk with two faults bring a little personality to the classroom while keeping the focus on programming.
What’s included
20 debugging activities covering syntax errors, runtime errors and logic errors
10 code-tracing activities with structured trace tables and output prediction
A two-page diagnostic assessment with answers and suggested follow-up activities
Foundation, Developing and Stretch tasks
Two graduated hints for each debugging activity
Extension questions with teacher answers
An exit check and pupil reflection sheet
Teacher guidance, suggested timings, an activity map and assessment criteria
Python topics covered
Activities explore variables, assignment, input and type conversion, comparison operators, selection, Boolean logic, for loops, while loops and range endpoints.
Further tasks cover running totals, list indexing, list methods, string handling, functions, parameters, return values, integer division, remainders, nested loops, sentinel values and finding a maximum.
How pupils use the activities
Each debugging worksheet gives pupils a clear requirement and a short faulty program. They identify the problem, explain its cause, write a repair and complete a test table.
The tracing worksheets ask pupils to follow changing values, predict the exact output and explain how a change would affect the program. This gives teachers evidence of pupils’ understanding beyond whether their code runs.
Flexible classroom use
Choose individual activities for starters, homework, retrieval practice or intervention. Combine related tasks for a longer lesson, or use familiar topics for cover work.
Most tasks have suggested timings of approximately 8 to 20 minutes, with additional time available for extensions and discussion. Pupils can work independently or in pairs. Printable activities can also be completed through manual tracing without a computer.
Something went wrong, please try again later.
This resource hasn't been reviewed yet
To ensure quality for our reviews, only customers who have purchased this resource can review it
Report this resourceto let us know if it violates our terms and conditions.
Our customer service team will review your report and will be in touch.