Pseudocode
Pseudocode is a way of writing down an algorithm in plain, English-like statements instead of the strict syntax of a programming language, so there are no fussy rules about brackets, colons or semicolons.
Its main job is to let you concentrate on the logic of an algorithm — the order of the steps and the decisions it makes — rather than the exact syntax of one language. You can plan in pseudocode, check that the logic works, then translate it into a language such as Python. It need not be precise down to the last symbol, but it must be unambiguous: anyone following it should carry out exactly the same steps and get the same result.
An algorithm can be represented as a flowchart, as pseudocode or as program code. A flowchart is a diagram, while the other two are written down; pseudocode sits between them, structured like code but readable like English.
Keywords do the job of the symbols you meet in code: IF and ELSE for selection; FOR, WHILE and REPEAT UNTIL for loops; INPUT and OUTPUT; comparisons such as <>; arithmetic such as *; INT, REAL and STR for type conversion; and <- or = to store a value. Writers use different words for the same idea, so a style unlike the one you have seen is not wrong as long as the logic stays clear.
This program works out how many boxes are needed, with 12 apples in each box:
apples = int(input("How many apples? "))
box_size = 12
boxes = apples // box_size
if apples % box_size != 0:
boxes = boxes + 1
print("Boxes needed: " + str(boxes))Output when the user types 30:
How many apples? 30
Boxes needed: 3
The same algorithm in pseudocode is a short list of English-like steps: input how many apples there are, set the box size to 12, work out the full boxes, add one more box if apples are left over, then output the answer. The logic is identical, but pseudocode keeps your attention on the steps and the leftover check rather than on int() and str().