Edexcel GCSE Computer Science Topic 6 Problem solving with programming: developing code, constructs, data types, strings, files, validation and subprograms in Python
A deep-dive Edexcel GCSE Computer Science guide to Topic 6 Problem solving with programming, the onscreen Python paper. Covers developing and debugging code, the program constructs, primitive and structured data types, string handling, input, output and CSV files, validation, authentication and subprograms.
Reviewed by: AI editorial process; not yet individually human-reviewed
Jump to a section
What Topic 6 actually demands
Problem solving with programming is the practical heart of the qualification, assessed in the onscreen Paper 2 in Python 3. You must be able to design, read, write, refine and debug programs that solve real problems, using the constructs, data types, string operations, file handling, validation, authentication, operators and subprograms in the Programming Language Subset. This is a doing skill, so it must be practised at the keyboard.
This guide ties together the seven dot-point pages for Topic 6.
Developing code and the constructs
Good development uses decomposition and abstraction, converts an algorithm into code, and writes readable code (layout, indentation, comments, meaningful identifiers, white space). The three error types are syntax (will not run), logic (wrong result) and runtime (crashes), found by tracing and testing. The constructs are sequence, selection (if/elif/else), repetition (for for a known count, while for a condition) and iteration over a structure, with single entry and exit points.
Data, strings and files
The primitive types are integer, real, Boolean and char; the structured types are string, array (a list, in one or two dimensions) and record. Use variables for changing values and constants for fixed ones. String handling covers length (len), position (indexing from 0), substrings (slicing s[start:end]) and case conversion (upper, lower). Input is read with input() (always text, so convert), and CSV files are read and written with open(), looping over lines and using split(",").
Validation, authentication and subprograms
Validation checks input is sensible (length, presence, range and pattern checks), normally with a loop that re-prompts until the input is valid, to make programs robust. Authentication confirms identity by comparing an ID and password (a lookup) against stored values, granting access only if both match. Subprograms are functions (return a value) and procedures (do not), with parameters; programs also use the arithmetic, relational and logical operators, and local variables (inside a subprogram) versus global variables (anywhere).
Check your knowledge
A mix of recall and short coding questions covering Topic 6. Attempt them, then check against the solutions.
- State the three types of program error. (1 mark)
- State what
input()returns in Python. (1 mark) - State the value of
17 % 5. (1 mark) - State what
"computer"[0:3]returns. (1 mark) - State which file mode replaces a file's contents. (1 mark)
- Name the validation check that confirms a field is not blank. (1 mark)
- State the difference between a function and a procedure. (1 mark)
- State where a local variable can be used. (1 mark)
Sources & how we know this
- Pearson Edexcel GCSE (9-1) Computer Science (1CP2) specification — Pearson (2020)
- Pearson Edexcel GCSE Computer Science Programming Language Subset (Python) — Pearson (2020)