Edexcel GCSE Computer Science past paper questions, worked and runnable
Pearson Edexcel GCSE Computer Science (1CP2) past paper questions: the on-screen Python paper (Paper 2) and the computational thinking questions from the written paper (Paper 1). Programs to fix, finish, rearrange and write, trace tables, flowcharts and searches, each worked through with a Python answer that you can run in your browser.
Paper 2, Application of Computational Thinking, is sat at a computer: you are given Python files to fix, complete or write. Paper 1 is written, and its computational thinking question asks you to trace, read and reason about code. For each question below we say what it tests and link the lesson that teaches it. Where it says Worked answer, there is a complete program of our own to run. Questions that only make sense with Pearson's own code file open, and the theory questions on Paper 1, are listed without one. We do not host the papers. Each one is linked on Pearson's own site.
By type of question
Complete the program
- June 2025 Paper 2, Question 2: A rocket countdown with validation and time.sleep (10 marks)
- June 2025 Paper 2, Question 4: Write a multiplication square to a file with commas (11 marks)
- June 2024 Paper 2, Question 2: Choose the right lines to make a Caesar cipher with ord() and chr() (10 marks)
- June 2024 Paper 2, Question 3: Price a purchase by count or by weight, with constants and validation (10 marks)
- June 2024 Paper 2, Question 5: A menu loop with getChoice, getShape and addShape subprograms (15 marks)
- June 2023 Paper 2, Question 5: A user ID: local and global names, a procedure, lower(), isdigit() and ord() (15 marks)
- June 2022 Paper 2, Question 1: Turn a number from 5 to 30 into a letter with chr(), with a range check (10 marks)
- June 2022 Paper 2, Question 3: The area of card left when a circle is cut from a square (10 marks)
- Sample Paper 2, Question 1: Roll a dice: import random, a variable, a constant, randint and a print (7 marks)
- Sample Paper 2, Question 5: The volume of a cone from a subprogram, printed to three decimal places (15 marks)
Write a program
- June 2025 Paper 2, Question 5: Draw lines and nine coloured circles with turtle graphics (15 marks)
- June 2025 Paper 2, Question 6: Validate keys with a check digit and signal readings, with a subprogram (15 marks)
- June 2024 Paper 2, Question 4: Turn a flowchart for a cafe order into Python, rounding up with math.ceil (15 marks)
- June 2024 Paper 2, Question 6: Read a CSV file of cows into records with a key, and display the table (15 marks)
- June 2023 Paper 2, Question 4: The volume of a prism: validation, rounding and format() in 8 columns (15 marks)
- June 2023 Paper 2, Question 6: Authenticate against a 2D array with three outcomes (15 marks)
- June 2022 Paper 2, Question 5: Write a list to a CSV file, seven values to a line (15 marks)
- June 2022 Paper 2, Question 6: A linear search of a sorted 2D list that stops early and suggests a word (15 marks)
- Sample Paper 2, Question 6: A login search of a sorted 2D list with passcode validation and an early stop (15 marks)
Fix the code
- June 2025 Paper 2, Question 1: Fix nine errors in a program that discounts a restaurant bill (9 marks)
- June 2023 Paper 2, Question 2: Fix syntax, name, index and logic errors in a program that picks random exercises (8 marks)
- June 2022 Paper 2, Question 2: Fix ten errors in a turtle graphics program (10 marks)
- Sample Paper 2, Question 3: Odd or even from 1 to 20: a runtime error, logic errors and messages (13 marks)
Rearrange the lines
- June 2025 Paper 2, Question 3: Rearrange mixed-up lines: ASCII totals and a digit added by divisibility (15 marks)
- June 2022 Paper 2, Question 4: Rearrange mixed-up lines: binary to denary with a doubling multiplier (15 marks)
- Sample Paper 2, Question 4: Rearrange mixed-up lines: year group to Primary, Secondary or College, until 0 (15 marks)
Trace table
- June 2025 Paper 1, Question 5(a) to (c): Computational thinking: a three-input truth table, a 2D array with a logic error, a factors trace table (10 marks)
- June 2022 Paper 1, Question 5: Computational thinking: a search that stops early, the strawberry trace table, a flowchart (18 marks)
Explain
- June 2025 Paper 1, Question 5(d), (e): Computational thinking: best and worst cases, and a binary search table for a missing value (10 marks)
- June 2023 Paper 1, Question 4: Computational thinking: trace tables and records, an odd or even flowchart, linear search, S AND M (20 marks)
Read the code
Paper by paper
June 2025, Paper 1 (1CP2/01)
Sat 12 May 2025, 75 marks. On Pearson's site: question paper, mark scheme.
| Question | What it tests | Type | Marks | Learn it | |
|---|---|---|---|---|---|
| 1 | Data: binary, hexadecimal, two's complement, compression, images and sound | Short answer | 17 | F8.2 Binary and denary F8.5 Negative numbers: two's complement F8.9 Compression | |
| 2 | Computers: languages and translators, the CPU, storage, embedded systems and the OS | Short answer | 17 | F6.5 Languages and translators F9.4 The CPU and fetch-execute | |
| 3 | Issues and impact: the environment, the law, privacy and a six mark discussion | Short answer | 8 | F12.1 Impacts of technology F12.2 Personal data and privacy | |
| 4 | Networks: LANs, WANs, packets, protocols, security and topologies | Short answer | 13 | F10.1 What is a network? F10.7 Protocols | |
| 5(a) to (c) | Computational thinking: a three-input truth table, a 2D array with a logic error, a factors trace table | Trace table | 10 | F9.1 Logic gates and truth tables F3.5 Two-dimensional arrays F13.2 Trace tables | Worked answer |
| 5(d), (e) | Computational thinking: best and worst cases, and a binary search table for a missing value | Explain | 10 | F5.6 Binary search F5.5 Linear search F5.7 Bubble sort | Worked answer |
June 2025, Paper 2 (1CP2/02)
Sat 20 May 2025, 75 marks. On Pearson's site: question paper, mark scheme.
June 2024, Paper 1 (1CP2/01)
Sat 15 May 2024, 75 marks. On Pearson's site: question paper, mark scheme.
| Question | What it tests | Type | Marks | Learn it | |
|---|---|---|---|---|---|
| 1 | Computational thinking: constructs by line number, errors, operators, and search and sort names | Read the code | 16 | F2.6 Condition-controlled loops: while F1.9 Arithmetic operators F5.6 Binary search | Worked answer |
| 2 | Data: binary, hexadecimal, two's complement, compression, images and sound | Short answer | 16 | F8.2 Binary and denary F8.5 Negative numbers: two's complement F8.9 Compression | |
| 3 | Networks: LANs, WANs, packets, protocols, security and topologies | Short answer | 14 | F10.1 What is a network? F10.7 Protocols | |
| 4 | Computers: languages and translators, the CPU, storage, embedded systems and the OS | Short answer | 17 | F6.5 Languages and translators F9.4 The CPU and fetch-execute | |
| 5 | Issues and impact: the environment, the law, privacy and a six mark discussion | Short answer | 12 | F12.1 Impacts of technology F12.2 Personal data and privacy |
June 2024, Paper 2 (1CP2/02)
Sat 21 May 2024, 75 marks. On Pearson's site: question paper, mark scheme.
June 2023, Paper 1 (1CP2/01)
Sat 19 May 2023, 75 marks. On Pearson's site: question paper, mark scheme.
| Question | What it tests | Type | Marks | Learn it | |
|---|---|---|---|---|---|
| 1 | Computers: languages and translators, the CPU, storage, embedded systems and the OS | Short answer | 15 | F6.5 Languages and translators F9.4 The CPU and fetch-execute | |
| 2 | Networks: LANs, WANs, packets, protocols, security and topologies | Short answer | 12 | F10.1 What is a network? F10.7 Protocols | |
| 3 | Issues and impact: the environment, the law, privacy and a six mark discussion | Short answer | 9 | F12.1 Impacts of technology F12.2 Personal data and privacy | |
| 4 | Computational thinking: trace tables and records, an odd or even flowchart, linear search, S AND M | Explain | 20 | F5.2 Flowcharts F5.5 Linear search F9.1 Logic gates and truth tables | Worked answer |
| 5 | Data: binary, hexadecimal, two's complement, compression, images and sound | Short answer | 19 | F8.2 Binary and denary F8.5 Negative numbers: two's complement F8.9 Compression |
June 2023, Paper 2 (1CP2/02)
Sat 25 May 2023, 75 marks. On Pearson's site: question paper, mark scheme.
| Question | What it tests | Type | Marks | Learn it | |
|---|---|---|---|---|---|
| 1 | Name the constant, the array and the line numbers of each construct in a given file | Read the code | 7 | F1.6 Variables, constants and assignment F2.7 Loop patterns | |
| 2 | Fix syntax, name, index and logic errors in a program that picks random exercises | Fix the code | 8 | F1.4 Errors: syntax, runtime and logic F6.4 Debugging logic errors F3.7 Random numbers | Worked answer |
| 3 | Choose the right lines to read one file, count matches and write another | Complete the program | 15 | F7.1 Reading and writing files F3.1 String handling | |
| 4 | The volume of a prism: validation, rounding and format() in 8 columns | Write a program | 15 | F6.1 Defensive design and validation F1.9 Arithmetic operators F13.4 Programming questions | Worked answer |
| 5 | A user ID: local and global names, a procedure, lower(), isdigit() and ord() | Complete the program | 15 | F4.3 Local and global variables F3.2 Character codes and conversion F4.1 Writing functions | Worked answer |
| 6 | Authenticate against a 2D array with three outcomes | Write a program | 15 | F6.2 Authentication F3.5 Two-dimensional arrays F13.4 Programming questions | Worked answer |
June 2022, Paper 1 (1CP2/01)
75 marks. On Pearson's site: question paper, mark scheme.
| Question | What it tests | Type | Marks | Learn it | |
|---|---|---|---|---|---|
| 1 | Networks: LANs, WANs, packets, protocols, security and topologies | Short answer | 13 | F10.1 What is a network? F10.7 Protocols | |
| 2 | Computers: languages and translators, the CPU, storage, embedded systems and the OS | Short answer | 18 | F6.5 Languages and translators F9.4 The CPU and fetch-execute | |
| 3 | Data: binary, hexadecimal, two's complement, compression, images and sound | Short answer | 16 | F8.2 Binary and denary F8.5 Negative numbers: two's complement F8.9 Compression | |
| 4 | Issues and impact: the environment, the law, privacy and a six mark discussion | Short answer | 10 | F12.1 Impacts of technology F12.2 Personal data and privacy | |
| 5 | Computational thinking: a search that stops early, the strawberry trace table, a flowchart | Trace table | 18 | F5.4 Trace tables F5.2 Flowcharts F5.5 Linear search | Worked answer |
June 2022, Paper 2 (1CP2/02)
75 marks. On Pearson's site: question paper, mark scheme.
Sample assessment material, Paper 2 (1CP2/02)
75 marks. On Pearson's site: question paper, mark scheme.
| Question | What it tests | Type | Marks | Learn it | |
|---|---|---|---|---|---|
| 1 | Roll a dice: import random, a variable, a constant, randint and a print | Complete the program | 7 | F3.7 Random numbers F1.6 Variables, constants and assignment | Worked answer |
| 2 | Fix three syntax errors and tidy a program that sings a countdown | Fix the code | 10 | F1.4 Errors: syntax, runtime and logic F1.5 Comments and readable code | |
| 3 | Odd or even from 1 to 20: a runtime error, logic errors and messages | Fix the code | 13 | F6.4 Debugging logic errors F1.9 Arithmetic operators F6.1 Defensive design and validation | Worked answer |
| 4 | Rearrange mixed-up lines: year group to Primary, Secondary or College, until 0 | Rearrange the lines | 15 | F2.3 else, elif and Boolean operators F2.6 Condition-controlled loops: while | Worked answer |
| 5 | The volume of a cone from a subprogram, printed to three decimal places | Complete the program | 15 | F4.2 Parameters and return values F4.5 Libraries and your own modules F1.9 Arithmetic operators | Worked answer |
| 6 | A login search of a sorted 2D list with passcode validation and an early stop | Write a program | 15 | F5.5 Linear search F3.5 Two-dimensional arrays F6.2 Authentication | Worked answer |
The specification
Pearson Edexcel GCSE Computer Science (1CP2), point by point, with the lesson for each section.
These are our own explanations of published exam questions. 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.