Practical Examples (GCSE Pseudocode & Python)

Test yourself on Selection (IF Statements) with exam style questions, marked instantly.

Flashcards that come back just before you would forget them.

A revision plan that remembers what you know and shows what to do next.

See which topics you have nailed and which need another look.

Quiz yourself on Selection (IF Statements)Get your flashcardsBuild my revision planTrack my progress

Practical Examples (GCSE Pseudocode & Python)

Example 1: Grade Calculator

GCSE Pseudocode:

INPUT score
if score >= 70 then
    grade = "A"
elseif score >= 60 then
    grade = "B"
elseif score >= 50 then
    grade = "C"
elseif score >= 40 then
    grade = "D"
else
    grade = "U"
endif
OUTPUT "Grade: " + grade

Python Equivalent:

score = int(input("Enter score: "))
if score >= 70:
    grade = "A"
elif score >= 60:
    grade = "B"
elif score >= 50:
    grade = "C"
elif score >= 40:
    grade = "D"
else:
    grade = "U"
print("Grade:", grade)

Example 2: Login Validation

INPUT username
INPUT password
if username == "admin" AND password == "secret123" then
    OUTPUT "Access granted"
    loggedIn = true
else
    OUTPUT "Access denied"
    loggedIn = false
endif

Make this stick

Signing in gives access to all PrepWise features.

PrepWise is a trading name of A3M Quality Solutions Limited, registered in England and Wales, company number 14959172. Registered office: 202 Stroud Road, Gloucester, GL1 5LA. ICO registration ZC267069.