Skip to content
IGCSE·Tuition

Study routes

Check current pseudocode versus future Python requirements

Your code runs in Python, but the exam question asks for pseudocode, and the two keep getting mixed together.

On this page
  1. What is the real difference?
  2. How do I translate a loop step by step?
  3. Worked example
  4. The mistake to watch for
  5. Where else do the two notations differ?
  6. Self-check
  7. When might one-to-one tuition be worth considering?

Pseudocode and Python solve the same problem in different notations, and the syllabus for your exam year decides which one a question expects. Do not rely on a video, a friend’s notes or a website written for another year. Read the current syllabus on the Cambridge page for your code.

This page shows how to translate between the two, which differences cause wrong answers, and what to check. The safe Python reasoning sandbox lets you run small original exercises and watch the output.

What is the real difference?

Pseudocode is a plan written for people. It has no fixed grammar on your computer, so nothing “errors” if you miss a colon. Python is a language a computer executes, so a missing colon or wrong indent stops the program.

Because pseudocode is for readers, marks usually go to clear logic: the right loop, the right condition, the right variable updates. Python in practical work is judged by whether it runs and gives the right result. Check your syllabus for how each is assessed in your year.

How do I translate a loop step by step?

  1. Write the plain-English steps first: start a total at zero, add each number from 1 to 5, output the total.
  2. Write the pseudocode using the layout your syllabus guide shows.
  3. Translate line by line into Python, checking the loop bounds and the start values.
  4. Trace both by hand with the same input and compare.

Worked example

Task: add the whole numbers from 1 to 5 and output the total.

Pseudocode:

total ← 0
FOR i ← 1 TO 5
   total ← total + i
NEXT i
OUTPUT total

Python:

total = 0
for i in range(1, 6):
    total = total + i
print(total)

Trace: i takes the values 1, 2, 3, 4, 5, so total becomes 1, 3, 6, 10, 15. Both versions output 15.

Notice the bound. In the pseudocode, FOR i ← 1 TO 5 includes 5. In Python, range(1, 6) stops before 6, so 5 is included only because the end value is 6.

The mistake to watch for

A student copies the pseudocode bound straight across and writes range(1, 5).

That loop gives i = 1, 2, 3, 4, so the total is 1 + 2 + 3 + 4 = 10, not 15. The program runs without any error message, so it feels correct. The answer is wrong by exactly the missing last value.

The fix is to trace by hand with the smallest case. Ask “is my last value used?” before you run anything.

Where else do the two notations differ?

IdeaWatch for
Position in a list or arraySome pseudocode guides start at 1, Python lists start at 0
Whole-number divisionPseudocode often uses DIV and MOD, Python uses // and %
Assignment and comparisonPseudocode may use ← and =, Python uses = and ==
Block endingsPseudocode uses words such as NEXT or ENDIF, Python uses indentation

Check your own pseudocode guide for the exact keywords it uses.

Self-check

  1. What is the Python loop for “add the numbers from 2 to 6”? What is the total?
Show answer `for i in range(2, 7):` gives 2, 3, 4, 5, 6. The total is 2 + 3 + 4 + 5 + 6 = 20.
  1. The pseudocode is FOR i ← 3 TO 6. How many times does the loop body run?
Show answer i takes 3, 4, 5 and 6, so the body runs 4 times.
  1. What do 17 DIV 5 and 17 MOD 5 give?
Show answer 17 DIV 5 = 3 (the whole-number quotient) and 17 MOD 5 = 2 (the remainder), because 3 × 5 + 2 = 17. In Python these are `17 // 5` and `17 % 5`.

When might one-to-one tuition be worth considering?

Self-study is usually enough when you only need to learn a few notation differences. A teacher is worth considering when your programs run but keep giving wrong outputs, or when you lose marks on trace tables and pseudocode even though you can code.

A teacher can work on your own attempts, find the repeated habit, and build a short routine. You can read how we teach this subject on the Computer Science tuition page, see the Computer Science learning guide, or try a boundary test before editing code.

Questions people ask

Do I have to write Python in the IGCSE Computer Science exam?

Do not assume either way. The rules depend on your syllabus and exam year. Open the Cambridge Computer Science 0478 page, download the syllabus for your year, and read what it says about pseudocode and programming languages. Then confirm with your school or exam centre.

Is pseudocode just Python with different words?

No. Pseudocode describes the steps of an algorithm so a reader can follow the logic without knowing a language. Python is a real language with strict syntax, indentation and built-in behaviour. Loop bounds, indexing and division can differ between them.

Which one should I practise more?

Practise both, with the same problem. Write the pseudocode first, then the Python, then compare. This shows you which habits carry over and which do not, and it prepares you for either style of question.

What if my school teaches a different language from Python?

The thinking skills are the same. Keep your own language for practical work, and learn the pseudocode conventions your syllabus uses. Ask your teacher which language the course expects and check the syllabus yourself.

Sources

  1. Cambridge IGCSE Computer Science 0478 syllabus page

Updated:

Your next step

If you can write a working program but lose marks when the exam wants a different notation, a one-to-one teacher can trace your own answers and show exactly where the translation breaks.

Paid one-hour trial at your assigned teacher’s confirmed rate, starting from RM80. Other fees, schedules and ongoing arrangements are confirmed directly with your teacher after the trial class.

9,000+ students helped through our service