Common keywords
Pseudocode uses a few standard keywords:
INPUT/READ: take data in.OUTPUT/PRINT: show data.IF / ELSE / END IF: branch.FOR / WHILE: loop.SET: assign a value.
SET total = 0
WHILE items remain
SET total = total + next item
END WHILE
OUTPUT total
You can translate these keywords almost directly into Python, Java, or JavaScript.
Why not just write real code?
Pseudocode is a design tool. You can plan the logic before you worry about semicolons or type declarations. Writing it first means fewer bugs later.
# Pseudocode (logic)
IF player has no lives:
PRINT "Game over"
# later -> real Python
if player.lives <= 0:
print("Game over")
The pseudocode stays correct even if you switch languages.