31 May 2026
After hundreds of thousands of student submissions - the Python mistakes that come up every time
CodeBash launched in September 2025. Since then, students have submitted hundreds of thousands of coding attempts across GCSE and A-Level Python challenges. I have spent a lot of time looking at where they go wrong and the patterns are interesting.
The mistakes are rarely random. They cluster. The same errors appear in cohort after cohort, school after school, and they tell us something useful about what students are actually thinking when they write code.
At GCSE, the number one area is data types. Students know what a variable is. They know what input() does. What they do not internalise early enough is that input() always returns a string, and that Python will not silently convert it for them. The error of adding a string to an integer is a rite of passage for almost every student. Right behind that: list aliasing. Students copy a list with = and genuinely cannot understand why both lists change when they only edited one.
At A-Level, the patterns shift. Recursion causes the most difficulty - not writing it, but debugging it. Students write a recursive function, forget the base case, hit maximum recursion depth, and have no mental model for why. OOP is the other major area. The class variable versus instance variable distinction trips up even strong students, as does forgetting to call the parent constructor in a subclass.
What I find most interesting is that these are not careless mistakes. They are conceptual ones. Students write exactly what they mean, they just mean something subtly different from what Python does.
I have turned this analysis into two free booklets: one for KS3/GCSE (110 mistakes across 11 categories) and one for A-Level (130 mistakes across 13 categories). Each mistake includes the wrong code, the correct code, and a teacher tip drawn from real classroom experience.
In the classroom, these work well as starter activities - project the wrong code, give students 60 seconds to spot the issue before revealing the fix. They also work as pre-assessment checklists or structured debugging exercises. The format makes it easy to drop individual mistakes into a lesson without any preparation.
Download both for free at https://www.codebash.co.uk/resources.
Eoin Shannon
Head of Computing | CodeBash
codebash.co.uk
Discussion
Please login to post a comment