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.

๐Ÿ“ Edexcel students? Practise Paper 2 challenges here
☰ Browse by Topic
Difficulty:

Iteration (for loops)

Repeating code a set number of times using for loops and range().

Never done this before? Learn it first →

EasyIteration (for loops)
Countdown Bottles Challenge
Write a program that prompts the user to enter a number of bottles, then counts down from that number to zero with a rep
EasyIteration (for loops)
Multiplication Table
Write a program that prompts the user to enter a number, and then outputs the multiplication table for that number up to
EasyIteration (for loops)
Number Squares Challenge
Write a program that outputs the squares of numbers from 1 to 20.
EasyIteration (for loops)
Sum of Natural Numbers
Write a program that calculates the sum of natural numbers up to a given limit using a for loop.
MediumIteration (for loops)
Factorial Calculator
Write a program that calculates the factorial of a given number. The factorial of a non-negative integer n, denoted by n
MediumIteration (for loops)
Print Pattern
Develop a program that prints a specific pattern using a for loop.
MediumIteration (for loops)
Print Prime Numbers
Create a program that prints all prime numbers up to a given limit using a for loop.
HardIteration (for loops)
FizzBuzz
Write a program that outputs numbers from 1 to 100. For multiples of three, output "Fizz"; for multiples of five, output
HardIteration (for loops)
Prime Number Generator
Write a program that generates and displays all prime numbers within a specified range. A prime number is a natural numb
HardIteration (for loops)
Random Math Quiz
Write a program that asks the user ten random math questions and tells them if they are correct. At the end, output how
EasyIteration (for loops)
Vertical Name Banner
Loop through a name one character at a time and print each letter on its own line.
EasyIteration (for loops)
Star Rating Display
Use a for loop with range() to print star ratings.
EasyIteration (for loops)
Times Table Generator
Generate a times table using a for loop and range().
MediumIteration (for loops)
Class Average Calculator
Use a counting loop to total scores and calculate an average.
EasyIteration (for loops)
Countdown Timer
Create a countdown using range() with a negative step.
MediumIteration (for loops)
Name Letter Counter
Iterate through a string using a for loop to count specific characters.
HardIteration (for loops)
Multiplication Grid
Use nested for loops to create a multiplication grid.
HardIteration (for loops)
Fibonacci Sequence Generator
Generate Fibonacci numbers using a for loop with running values.
MediumIteration (for loops)
Shopping Receipt Totaller
Use a for loop to collect item prices and calculate running total.