← Edexcel International GCSE

Selection: Edexcel International GCSE practice

if, else and nested conditions. 11 questions in the style of the Edexcel International GCSE exam.

Sample questions

What is printed when this code runs?

score = 65
if score >= 70:
    print("Merit")
elif score >= 50:
    print("Pass")
else:
    print("Fail")
  1. Merit
  2. Pass
  3. Fail
  4. Nothing is printed

What does this program print?

age = 16
member = False
if age < 16:
    if member:
        print("Junior member")
    else:
        print("Junior guest")
else:
    if member:
        print("Adult member")
    else:
        print("Adult guest")

What does this program print?

a = 5
b = 12
if a > 3 and not b > 10:
    print("X")
elif a > 3 or b < 10:
    print("Y")
else:
    print("Z")
if b % a == 2:
    print("W")