Revise Computing
Revision notesQuestionsFor schools
Log inStart revising free
Revision notesQuestionsFor schoolsLog in
GCSE Computer Science/Paper 2/Designing, creating and refining algorithms

Common errors

Identify common errors

2.1.2 Designing, creating and refining algorithms

Practise exam questions

Designing, creating and refining algorithms — Note 6 of 7

Identify syntax/logic errors in code and suggest fixes

What you need to know

When writing or reading algorithms, you need to be able to identify two types of error: syntax errors and logic errors. Syntax errors break the rules of the programming language and stop the program from running. Logic errors allow the program to run but produce incorrect or unexpected results. Being able to spot and fix both is a key programming skill.

What to know

  • Common syntax errors: misspelling keywords (printt), missing brackets, missing quotation marks, incorrect indentation, using =< instead of <=.
  • Common logic errors: using the wrong variable (num1 + num1 instead of num1 + num2), incomplete conditions, wrong loop bounds, wrong operator.
  • Syntax errors are flagged by the IDE or interpreter and are easier to fix.
  • Logic errors are harder to find because the program still runs; testing helps identify them.
  • You should be able to suggest fixes for both types of error in exam questions. Write the corrected LINE of code.

Key terms

Syntax error

Breaks the rules/grammar of the programming language; prevents the program from running/executing.

Logic error

The program runs but produces incorrect/unexpected results/output.

Exam technique

  • Tip:A DEFINITION must be general. 'Missing bracket' is an EXAMPLE of a syntax error, not a definition. The definition is 'breaks the rules/grammar of the language'.
  • Tip:'Error in the syntax' or 'error in the logic' are NOT acceptable definitions (circular). 'Does not work' is too vague.

Code examples

Syntax error vs Logic error
python
# SYNTAX ERROR - missing closing bracket
# print("Hello World"

# LOGIC ERROR - wrong formula
distance = 100
time = 20
speed = time / distance  # Should be distance / time
print(speed)  # Outputs 0.2 instead of 5.0

Ready to test yourself?

Practise 2.1.2 questions
← Previous noteReference language/high-level programming language2.1.2 Designing, creating and refining algorithmsNext note →Trace tables2.1.2 Designing, creating and refining algorithms

Back to Designing, creating and refining algorithms

Revise another OCR GCSE topic: Searching and sorting algorithms, Computational Thinking

Designing, creating and refining algorithms

Note 6 of 7

  1. 1The inputs, processes, and outputs for a problem
  2. 2Structure diagrams
  3. 3Pseudocode
  4. 4Flowcharts
  5. 5Reference language/high-level programming language
  6. 6Common errors
  7. 7Trace tables
Topic overview

© 2026 Revise Computing · revisecomputing.co.uk

Privacy noticeTermsContact

Revise Computing is an independent revision resource. It is not affiliated with, or endorsed by, OCR (Oxford Cambridge and RSA Examinations).