The Pearson / Edexcel GCSE in Computer Science has a practical on-screen python exam which assesses your ability to read, understand, write and debug python code. In the actual exam you won’t have access to the Internet but you will have a copy of the Programming Language Subset which is a really useful reminder and reference guide.
For the second question of the on screen test you are given most of a python program and you have to fix some errors, choose between different options of lines or code or add some of your own lines of code.
This page has three practice Q2 style activities to help you prepare for the exam. In the actual exam you won’t be able to use an online IDE so these self marking activities are just designed to give you instant feedback as you practice and prepare for the exam. If you want to practice “offline”, you can download the questions and python files here:
The progress bar below shows how well you’ve done on each part of the three challenges. You can generate a PDF certificate to celebrate your progress if you click on the ✓ button next to where you enter your name.
Challenge 1: Target
Suggested time: 20 minutes
A programmer is designing a program which should display an archery target.
The program currently contains errors, but it should function as shown below:
Using the file Q02.py below:
Amend the code to:
- fix the syntax error on original line 5
- fix the syntax error on original line 13
COLOURS = "blue", "white", "black", "red", "gold"]
- fix the NameError on line 41
radius = SIZE
- fix the error on original line 52
y += width
- fix the logic error on line 55
fillCircle(y, x, colour, radius)
Do not add any additional functionality
If this was a real question it would tell you to save your code as Q02_FINISHED.py but you might want to save your code so you can show your teacher or come back to it later by pressing Ctrl + S or clicking on the icon that looks like this: