Python Programming Challenges
292 free challenges for GCSE Computer Science students. Perfect for OCR and AQA students looking to practise Python programming, or anyone who wants to sharpen their coding skills.
☰ Browse by Topic
Functions & Procedures
Writing reusable code with def, parameters, and return values.
Dart Score Keeper
Write a program that keeps track of a player's score in a darts game, subtracting each turn's score from the total.
GCD Calculator
Implement a function that calculates the greatest common divisor (GCD) of two numbers.
Measurement Converter
Write a program that provides a utility for converting between metric and imperial measurements. Each conversion should
Pig Dice Game
Write a program that plays the Pig Dice game, where players take turns rolling dice to accumulate points but risk losing
Function: Return the Larger
Write a function that returns the larger of two numbers, then use it.
Sports Day Scoreboard
Write the printing once as a subroutine, then call it for each house instead of repeating yourself.
Parcel Weight Function
Write one subroutine that returns a value and one that only prints, so the difference is obvious.
Shelf Space Scope
Read a global constant from inside a subroutine, do the working out in a local variable, and return the answer.
Greeting Procedure
Create a procedure that displays a greeting message using parameters.
Area Calculator Function
Create a function that calculates area and returns the result.
Validation Function
Create a reusable validation function with parameters for min and max.
Discount Calculator Function
Create a function that calculates discounted prices with multiple parameters.
Temperature Category Function
Create a function that returns a temperature category string.
Multi-Function Calculator
Build a program using multiple functions and procedures working together.
Password Generator Function
Create a function that generates passwords with configurable length.
List Statistics Function
Write functions that process a list parameter and return calculated statistics.