Python decisions and boundaries
A conditional evaluates a Boolean condition. The first matching branch runs; later branches in the same chain are skipped.
Python
def grade(score):
if score >= 80:
return "Distinction"
elif score >= 50:
return "Pass"
else:
return "Retry"
print(grade(80))
print(grade(49))
assert grade(50) == "Pass"