Selection: AQA GCSE practice
if, else and nested conditions. 14 questions in the style of the AQA 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")- Merit
- Pass
- Fail
- 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")