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.

Edexcel 1CP231 worked answers9 papersfree

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

Write a program

Fix the code

Rearrange the lines

Trace table

Explain

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.

QuestionWhat it testsTypeMarksLearn it
1Data: binary, hexadecimal, two's complement, compression, images and soundShort answer17F8.2 Binary and denary
F8.5 Negative numbers: two's complement
F8.9 Compression
2Computers: languages and translators, the CPU, storage, embedded systems and the OSShort answer17F6.5 Languages and translators
F9.4 The CPU and fetch-execute
3Issues and impact: the environment, the law, privacy and a six mark discussionShort answer8F12.1 Impacts of technology
F12.2 Personal data and privacy
4Networks: LANs, WANs, packets, protocols, security and topologiesShort answer13F10.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 tableTrace table10F9.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 valueExplain10F5.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.

QuestionWhat it testsTypeMarksLearn it
1Fix nine errors in a program that discounts a restaurant billFix the code9F1.4 Errors: syntax, runtime and logic
F6.4 Debugging logic errors
F2.3 else, elif and Boolean operators
Worked answer
2A rocket countdown with validation and time.sleepComplete the program10F2.6 Condition-controlled loops: while
F4.5 Libraries and your own modules
F6.1 Defensive design and validation
Worked answer
3Rearrange mixed-up lines: ASCII totals and a digit added by divisibilityRearrange the lines15F3.2 Character codes and conversion
F2.3 else, elif and Boolean operators
F2.6 Condition-controlled loops: while
Worked answer
4Write a multiplication square to a file with commasComplete the program11F7.1 Reading and writing files
F2.7 Loop patterns
F3.1 String handling
Worked answer
5Draw lines and nine coloured circles with turtle graphicsWrite a program15F4.5 Libraries and your own modules
F3.7 Random numbers
Worked answer
6Validate keys with a check digit and signal readings, with a subprogramWrite a program15F6.1 Defensive design and validation
F4.1 Writing functions
F3.5 Two-dimensional arrays
Worked answer

June 2024, Paper 1 (1CP2/01)

Sat 15 May 2024, 75 marks. On Pearson's site: question paper, mark scheme.

QuestionWhat it testsTypeMarksLearn it
1Computational thinking: constructs by line number, errors, operators, and search and sort namesRead the code16F2.6 Condition-controlled loops: while
F1.9 Arithmetic operators
F5.6 Binary search
Worked answer
2Data: binary, hexadecimal, two's complement, compression, images and soundShort answer16F8.2 Binary and denary
F8.5 Negative numbers: two's complement
F8.9 Compression
3Networks: LANs, WANs, packets, protocols, security and topologiesShort answer14F10.1 What is a network?
F10.7 Protocols
4Computers: languages and translators, the CPU, storage, embedded systems and the OSShort answer17F6.5 Languages and translators
F9.4 The CPU and fetch-execute
5Issues and impact: the environment, the law, privacy and a six mark discussionShort answer12F12.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.

QuestionWhat it testsTypeMarksLearn it
1Fix ten errors in a program that looks up rainbow colours by wavelengthFix the code10F1.4 Errors: syntax, runtime and logic
F6.4 Debugging logic errors
2Choose the right lines to make a Caesar cipher with ord() and chr()Complete the program10F3.2 Character codes and conversion
F11.6 Encryption
F3.1 String handling
Worked answer
3Price a purchase by count or by weight, with constants and validationComplete the program10F1.6 Variables, constants and assignment
F6.1 Defensive design and validation
F2.3 else, elif and Boolean operators
Worked answer
4Turn a flowchart for a cafe order into Python, rounding up with math.ceilWrite a program15F5.2 Flowcharts
F4.5 Libraries and your own modules
F1.6 Variables, constants and assignment
Worked answer
5A menu loop with getChoice, getShape and addShape subprogramsComplete the program15F4.2 Parameters and return values
F3.3 Lists: one-dimensional arrays
F2.6 Condition-controlled loops: while
Worked answer
6Read a CSV file of cows into records with a key, and display the tableWrite a program15F7.1 Reading and writing files
F3.6 Records
F3.1 String handling
Worked answer

June 2023, Paper 1 (1CP2/01)

Sat 19 May 2023, 75 marks. On Pearson's site: question paper, mark scheme.

QuestionWhat it testsTypeMarksLearn it
1Computers: languages and translators, the CPU, storage, embedded systems and the OSShort answer15F6.5 Languages and translators
F9.4 The CPU and fetch-execute
2Networks: LANs, WANs, packets, protocols, security and topologiesShort answer12F10.1 What is a network?
F10.7 Protocols
3Issues and impact: the environment, the law, privacy and a six mark discussionShort answer9F12.1 Impacts of technology
F12.2 Personal data and privacy
4Computational thinking: trace tables and records, an odd or even flowchart, linear search, S AND MExplain20F5.2 Flowcharts
F5.5 Linear search
F9.1 Logic gates and truth tables
Worked answer
5Data: binary, hexadecimal, two's complement, compression, images and soundShort answer19F8.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.

QuestionWhat it testsTypeMarksLearn it
1Name the constant, the array and the line numbers of each construct in a given fileRead the code7F1.6 Variables, constants and assignment
F2.7 Loop patterns
2Fix syntax, name, index and logic errors in a program that picks random exercisesFix the code8F1.4 Errors: syntax, runtime and logic
F6.4 Debugging logic errors
F3.7 Random numbers
Worked answer
3Choose the right lines to read one file, count matches and write anotherComplete the program15F7.1 Reading and writing files
F3.1 String handling
4The volume of a prism: validation, rounding and format() in 8 columnsWrite a program15F6.1 Defensive design and validation
F1.9 Arithmetic operators
F13.4 Programming questions
Worked answer
5A user ID: local and global names, a procedure, lower(), isdigit() and ord()Complete the program15F4.3 Local and global variables
F3.2 Character codes and conversion
F4.1 Writing functions
Worked answer
6Authenticate against a 2D array with three outcomesWrite a program15F6.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.

QuestionWhat it testsTypeMarksLearn it
1Networks: LANs, WANs, packets, protocols, security and topologiesShort answer13F10.1 What is a network?
F10.7 Protocols
2Computers: languages and translators, the CPU, storage, embedded systems and the OSShort answer18F6.5 Languages and translators
F9.4 The CPU and fetch-execute
3Data: binary, hexadecimal, two's complement, compression, images and soundShort answer16F8.2 Binary and denary
F8.5 Negative numbers: two's complement
F8.9 Compression
4Issues and impact: the environment, the law, privacy and a six mark discussionShort answer10F12.1 Impacts of technology
F12.2 Personal data and privacy
5Computational thinking: a search that stops early, the strawberry trace table, a flowchartTrace table18F5.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.

QuestionWhat it testsTypeMarksLearn it
1Turn a number from 5 to 30 into a letter with chr(), with a range checkComplete the program10F3.2 Character codes and conversion
F2.3 else, elif and Boolean operators
F1.8 Data types and casting
Worked answer
2Fix ten errors in a turtle graphics programFix the code10F1.4 Errors: syntax, runtime and logic
F6.4 Debugging logic errors
Worked answer
3The area of card left when a circle is cut from a squareComplete the program10F1.9 Arithmetic operators
F4.5 Libraries and your own modules
F6.1 Defensive design and validation
Worked answer
4Rearrange mixed-up lines: binary to denary with a doubling multiplierRearrange the lines15F8.2 Binary and denary
F4.2 Parameters and return values
F2.6 Condition-controlled loops: while
Worked answer
5Write a list to a CSV file, seven values to a lineWrite a program15F7.1 Reading and writing files
F3.4 Iterating over a list
F13.4 Programming questions
Worked answer
6A linear search of a sorted 2D list that stops early and suggests a wordWrite a program15F5.5 Linear search
F3.5 Two-dimensional arrays
F13.4 Programming questions
Worked answer

Sample assessment material, Paper 2 (1CP2/02)

75 marks. On Pearson's site: question paper, mark scheme.

QuestionWhat it testsTypeMarksLearn it
1Roll a dice: import random, a variable, a constant, randint and a printComplete the program7F3.7 Random numbers
F1.6 Variables, constants and assignment
Worked answer
2Fix three syntax errors and tidy a program that sings a countdownFix the code10F1.4 Errors: syntax, runtime and logic
F1.5 Comments and readable code
3Odd or even from 1 to 20: a runtime error, logic errors and messagesFix the code13F6.4 Debugging logic errors
F1.9 Arithmetic operators
F6.1 Defensive design and validation
Worked answer
4Rearrange mixed-up lines: year group to Primary, Secondary or College, until 0Rearrange the lines15F2.3 else, elif and Boolean operators
F2.6 Condition-controlled loops: while
Worked answer
5The volume of a cone from a subprogram, printed to three decimal placesComplete the program15F4.2 Parameters and return values
F4.5 Libraries and your own modules
F1.9 Arithmetic operators
Worked answer
6A login search of a sorted 2D list with passcode validation and an early stopWrite a program15F5.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.