Python Practice Questions for GCSE (With a Free Code Editor)
June 19, 2026
Reading about Python is not the same as writing it. To do well in the GCSE programming paper, you need to write code yourself, make mistakes, and fix them. This page gives you practice questions by topic, and you can solve every one of them in our free browser editor.
Variables and input
Write a program that asks for two numbers and prints their total.
a = int(input("First number: "))
b = int(input("Second number: "))
print(a + b)
If statements
Ask the user for their age and print whether they can vote (18 or over).
Loops
Print the 7 times table from 7 to 70 using a for loop.
for i in range(1, 11):
print(i * 7)
Lists
Create a list of five numbers and print the largest one without using max().
Functions
Write a function is_even(n) that returns True if a number is even and False otherwise.
How to practise effectively
- Type the code yourself — do not copy and paste.
- Run it, then deliberately break it to see the error message.
- Try the same problem a different way (for example, a while loop instead of a for loop).
- Check your answer against test cases so you know it is genuinely correct.
Our Python coding challenges cover every one of these topics with dozens of questions, each checked automatically against multiple test cases. You can write and run your answers in the free online Python IDE and get instant feedback.
Practise Python now.
Work through free, auto-marked coding challenges in your browser.
Try the challenges →