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 first question of the on screen test you are given most of a python program and you have to fill in the blanks. The blanks are either missing parts of a line of python code or spaces in a comment for you to write the answer to a question.

This page has three practice Q1 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: Gravity on Earth and the Moon

Suggested time: 15 minutes

A scientist wants to find out how much different items would weigh on the moon. They have written a program which allows you to enter the mass of an object in kg and it will tell you how much that object will weigh both on Earth and on the Moon.

The weight of an object is calculated using the following formula:

weight = mass × gravitational field strength

Using the file Q01.py below:

Amend the lines at the bottom of the code to give the:

  • identifier of a constant used in the code
  • name of a user defined function
  • data type of the layout variable
  • name of a parameter used in the code
  • arithmetic operator used in the code

Do not add any additional functionality

If this was a real question it would tell you to save your code as Q01FINISHED.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:

Save / share icon in create.withcode.uk lets you save your code