Edexcel GCSE Computer Science June 2025 Paper 2, Question 2: the rocket countdown
Pearson Edexcel 1CP2/02 June 2025, Question 2: complete a Python program that validates a number from 1 to 10 and counts down from it with a 1.5 second pause, using the time library. The ten marks explained, with the countdown to run on the robot.
Question 2 of the Pearson Edexcel GCSE Computer Science Paper 2 sat on 20 May 2025 (1CP2/02) is a 10 mark "complete the lines" question with a loop in it, and it uses a library most students have never met in an exam: time.
We do not copy the exam paper or Pearson's code files here. Open the paper beside this page: Edexcel June 2025 Paper 2 question paper (PDF). When you have finished, check the mark scheme too.
The question in short
The user enters a number from 1 to 10. The program counts down from it to 1, pausing 1.5 seconds between counts, and then displays "Ignition - lift off!". The wait time is a constant in the file.
You add: the import; countDown set to 0; the input converted to an integer; a validity check with two relational operators and one logical operator; a loop that stops at 0; the display of the count; a call to the time library to pause; the subtraction of 1; and the lift off message.
A finished program
import time
WAIT_TIME = 1.5
countDown = 0
countDown = int(input("What is the countdown? "))
if countDown > 0 and countDown <= 10:
while countDown > 0:
print(countDown)
time.sleep(WAIT_TIME)
countDown = countDown - 1
print("Ignition - lift off!")
else:
print("The countdown must be from 1 to 10")
Where the ten marks are
One each for: import time; countDown = 0; the input and the int(); the two relational tests; the logical operator and; the while loop condition; displaying countDown; time.sleep(WAIT_TIME); countDown = countDown - 1; and the lift off message in the right place, outside the loop.
Where the marks are lost
orin the validity check. Every number is either above 0 or at most 10, sooraccepts everything. The mark scheme refusesorby name.time.sleep(1.5)is accepted, but the constant is there to be used.sleep(WAIT_TIME)with notime.The function lives in the library, so it needs the library's name in front.- Lift off inside the loop. It would print after every number.
- Counting up. The loop must take 1 off each time and stop at 0.
Run it
The robot joins in: it blinks on each count and drives off at lift off. The simulator has its own clock, so the pause here is the robot's wait(); in the exam file it is time.sleep(WAIT_TIME), as in the model answer.
The program
from bugbot import *
connect()
WAIT_TIME = 1.5
countDown = 0
countDown = int(input("What is the countdown? "))
if countDown > 0 and countDown <= 10:
while countDown > 0:
led("yellow")
print(countDown)
wait(WAIT_TIME) # time.sleep(WAIT_TIME) in the exam
led("off")
countDown = countDown - 1
led("green")
print("Ignition - lift off!")
forward(100, distance=40)
else:
led("red")
print("The countdown must be from 1 to 10")
Questions
How do I pause a Python program?
Import the time library and call time.sleep(seconds). The argument can be a decimal, so time.sleep(1.5) pauses for a second and a half.
How do I check that a number is between 1 and 10?
Two comparisons joined with and: number > 0 and number <= 10, or number >= 1 and number <= 10.
Why does the loop stop at 0?
The condition is while countDown > 0. After the count reaches 1 and is reduced by 1, it is 0, the condition is false, and the loop ends without printing 0.
More from this paper
Every Edexcel 1CP2 question we have worked
Learn it step by step
- F2.6 Condition-controlled loops: while Decisions and loops
- F4.5 Libraries and your own modules Functions and structured code
- F6.1 Defensive design and validation Robust programs
This is our own explanation of a published exam question. It is not written or endorsed by Pearson, and the question paper and mark scheme remain Pearson's copyright. Read them on Pearson's site with the links on this page.