PRACTICE

Assertions & Edge Cases

Lesson notes

Your task

Define passes(score) for scores at least 60. Assert 60 passes and 59 fails, then print Tests passed.

Expected output
Tests passed
Loading…

OUTPUT

Worked solution
def passes(score):
    return score >= 60
assert passes(60) is True
assert passes(59) is False
print("Tests passed")

Checks compare printed output, not your approach. Several solutions can be valid.

← Back to courses