๐Ÿ’ก PseudoStudio IDE Tip: Our online compiler also has a built-in Python-to-Pseudocode conversion tool. Open the IDE and paste your Python code to get an instant pseudocode translation. Try the converter โž”

Quick Reference Table

Concept Python Cambridge Pseudocode
Print / Outputprint("Hello")OUTPUT "Hello"
Inputname = input("Enter name: ")INPUT name
Assign variablex = 5x โ† 5
Declare variable(not needed)DECLARE x : INTEGER
Integer divisionx // yx DIV y
Modulusx % yx MOD y
Not equalx != yx <> y
FOR loopfor i in range(1, 6):FOR i โ† 1 TO 5 ... NEXT i
WHILE loopwhile x < 10:WHILE x < 10 ... ENDWHILE
IF statementif x > 5:IF x > 5 THEN ... ENDIF
IF...ELSEif x > 5: ... else:IF x > 5 THEN ... ELSE ... ENDIF
List (Array)scores = [0] * 5 (0-indexed)DECLARE scores[1:5] : INTEGER (1-indexed)
String lengthlen("Hello")LENGTH("Hello")
Substring"Hello"[1:4]SUBSTRING("Hello", 2, 3)
Upper case"hello".upper()UCASE("hello")
Functiondef myFunc(x): return x*2FUNCTION myFunc(x : INTEGER) RETURNS INTEGER ... ENDFUNCTION
Proceduredef myProc(x): print(x)PROCEDURE myProc(x BYVAL : INTEGER) ... ENDPROCEDURE

Side-by-Side Examples

๐Ÿ Python
# Variables & output
name = input("Enter name: ")
age = int(input("Enter age: "))
print("Hello,", name)
print("Age:", age)
๐Ÿ“‹ Cambridge Pseudocode
// Variables & output
DECLARE name : STRING
DECLARE age : INTEGER
INPUT name
INPUT age
OUTPUT "Hello,", name
OUTPUT "Age:", age
๐Ÿ Python โ€” FOR Loop
for i in range(1, 11):
    print(i * i)
๐Ÿ“‹ Pseudocode โ€” FOR Loop
DECLARE i : INTEGER
FOR i โ† 1 TO 10
    OUTPUT i * i
NEXT i
๐Ÿ Python โ€” WHILE Loop
count = 1
while count <= 5:
    print(count)
    count += 1
๐Ÿ“‹ Pseudocode โ€” WHILE Loop
DECLARE count : INTEGER
count โ† 1
WHILE count <= 5
    OUTPUT count
    count โ† count + 1
ENDWHILE
๐Ÿ Python โ€” IF/ELSE
score = int(input("Score: "))
if score >= 70:
    print("Pass")
else:
    print("Fail")
๐Ÿ“‹ Pseudocode โ€” IF/ELSE
DECLARE score : INTEGER
INPUT score
IF score >= 70
    THEN OUTPUT "Pass"
    ELSE OUTPUT "Fail"
ENDIF
๐Ÿ Python โ€” List (Array)
scores = [0] * 5  # 0-indexed
for i in range(5):
    scores[i] = int(input())
print(scores[0])  # first item
๐Ÿ“‹ Pseudocode โ€” Array (1-indexed)
DECLARE scores[1:5] : INTEGER
DECLARE i : INTEGER
FOR i โ† 1 TO 5
    INPUT scores[i]
NEXT i
OUTPUT scores[1]  // first item
โš ๏ธ Key difference โ€” Array indexing: Python lists start at index 0. Cambridge pseudocode arrays start at index 1. This is one of the most common mistakes students make when translating between the two.
๐Ÿ Python โ€” Function
def square(n):
    return n * n

result = square(5)
print(result)
๐Ÿ“‹ Pseudocode โ€” FUNCTION
FUNCTION Square(n : INTEGER) RETURNS INTEGER
    RETURN n * n
ENDFUNCTION

DECLARE result : INTEGER
result โ† Square(5)
OUTPUT result

Use the Built-in Python โ†’ Pseudocode Tool

Paste any Python code into PseudoStudio IDE and we'll convert it to pseudocode automatically.

โ–ถ Open the IDE Converter

Learn More Pseudocode:

Full Cheat Sheet Loops Guide Arrays Guide Functions Guide Code Examples