Edexcel GCSE Computer Science 1CP2
Computational Thinking
Data
Computers
Networks
Issues and Impact
Problem Solving with Programming
Problem Solving with Programming
- 9 subtopics
- 27 things to know
- Paper 2
What Problem Solving with Programming covers
Problem Solving with Programming is examined in Paper 2, Application of Computational Thinking. It covers readable code, debugging and testing, selection and loops in Python, data types, conversion, variables and constants, string handling, lists, two-dimensional lists and records, keyboard input, screen output and CSV files, validation and authentication in Python, operators, functions and variable scope, and turtle graphics.
Where it is assessed
Paper 2
Application of Computational Thinking, a two-hour onscreen paper in Python worth 50% of the GCSE.
Check the Pearson Edexcel specification ↗The 9 subtopics
Each one has its own page.
- Readable code, debugging and testingIndentation, comments, identifiers and white space in Python, turning flowcharts into code, and finding and fixing syntax, logic and runtime errors.Open →
- Selection and loops in Pythonif, elif and else, range() with worked values, for and while loops, iteration over lists and strings, nested loops, and single entry and exit points.Open →
- Data types, conversion, variables and constantsInteger, real, Boolean and string in Python, a character as a one-letter string, converting input with int() and str(), and constants in capitals.Open →
- String handlinglen(), indexing and slicing, find() and index(), upper() and lower(), concatenation, split(), strip() and replace(), with worked outputs.Open →
- Lists, two-dimensional lists and recordsPython lists as arrays, append, insert and del, two-dimensional lists, records as lists of fields, and worked loops over lists of lists.Open →
- Keyboard input, screen output and CSV filesinput() and output, opening, reading, writing and closing CSV files, readline() and readlines(), splitting and stripping lines, and formatting output.Open →
- Validation and authentication in PythonPresence, length, range and pattern checks written in Python, validation loops, checking digits before conversion, and authentication by ID, password and lookup.Open →
- Operators, functions and variable scope%, // and ** with worked results, comparisons and logical operators, functions and procedures, parameters, built-in and library subprograms, and local and global variables.Open →
- Turtle graphicsCreating a turtle, moving and turning it, drawing shapes with loops, lifting and lowering the pen, pen colour, size and filled shapes, circles and arcs, setting position and heading, home and reset, standard and logo modes, speed, hiding the turtle, and the screen functions.Open →
What you need to know
Answer each one before you reveal it.
How can Python read a CSV file line by line, and how do readline() and readlines() differ?
Explain why indentation is essential in Python.
What is the difference between initialisation and assignment?
Which Python data types store a whole number and a number with a decimal part?
State what is printed by print(len("Hello world")).
How is an array represented in Python?
Define validation.
What is printed by print(23 % 4) and then print(23 // 4)?
How is a comment written in Python, and why are comments used?
Define a command sequence.
What values can a Boolean hold, and what is one used for?
What character is word[2] when word = "Python"?
What is printed by scores = [12, 15, 9, 20], then print(scores[2])?
Why do programs validate input?
What is printed by secs = 200, then print(str(secs // 60) + " min " + str(secs % 60) + " s")?
Why is score_total a better identifier than st?
What is printed when x = 7 runs through if x > 10: print("big"), then elif x > 5: print("medium"), then else: print("small")?
Describe how Python stores a single character.
State what is printed by word = "computer", then print(word[3:6]).
What does scores.append(7) do when scores = [12, 15, 9]?
What does name = input("Name: ") do when it runs?
What is a presence check, and how is one written in Python?
State what is printed by print(2 ** 10).
What do pen.pencolor("red") and pen.pensize(5) change?
What do hideturtle() and showturtle() do?
What do pen.left(90) and pen.right(90) do?
Take Problem Solving with Programming further
The same content, four other ways.
Commonly confused
Pairs that lose marks when they are blurred together.
Function vs Procedure
Function: a subprogram that hands a value back to the code that called it. Procedure: a subprogram that carries out a task without handing any value back.
Local variable vs Global variable
Local variable: a named value that exists only inside the subprogram where it is created. Global variable: a named value created in the main program that any part of the code can read.
Variable vs Constant
Variable: a named memory location whose value can change while the program runs. Constant: a named value that stays fixed while the program runs, written in capitals by convention.
Questions from this topic
Each one with the model answer underneath.
- 1
Explain why indentation is essential in Python.
Model answer
Python uses indentation to show which lines belong to a block, such as the body of a loop. Wrong indentation changes what the code does or causes an error.
- 2
How is a comment written in Python, and why are comments used?
Model answer
A comment starts with the # character, and Python ignores the rest of that line. Comments explain the purpose of the code to anyone maintaining it later.
- 3
Why is score_total a better identifier than st?
Model answer
The name score_total says what the variable holds. A reader can follow the code without guessing what st stands for.
- 4
How does white space make a program easier to read?
Model answer
Blank lines separate a program into logical sections. Spaces around operators make each line easier to scan.
- 5
How do a flowchart’s decision box and loop-back arrow become Python code?
Model answer
A decision box becomes an if statement testing the same condition. A loop-back arrow becomes a while loop that repeats until the decision lets control move on.
- 6
Explain what it means to refine a program.
Model answer
Refining a program means improving code that already works. The aim is clearer, shorter or more efficient code that gives the same results.
What is inside Levo
Six ways to work the same material.
Problem Solving with Programming revision questions
- What does Problem Solving with Programming cover in Edexcel GCSE Computer Science?
- 9 subtopics: readable code, debugging and testing, selection and loops in python, data types, conversion, variables and constants, string handling, lists, two-dimensional lists and records, keyboard input, screen output and csv files, validation and authentication in python, operators, functions and variable scope and turtle graphics. Each one has its own page with questions and model answers.
- How is Problem Solving with Programming organised?
- By the Edexcel 1CP2 specification, subtopic by subtopic, so it matches the order you are taught it in.
Every question in Problem Solving with Programming, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.