I'm struggling to understand how Python makes the association between the breakpoints sequence and the grades sequence.
def grade(score, breakpoints=[60, 70, 80, 90], grades='FDCBA'):
i = bisect.bisect(breakpoints, score)
return grades[i]
print([grade(score) for score in [33, 59, 99, 77, 70, 89, 90, 100]])
Result = ['F', 'F', 'A', 'C', 'C', 'B', 'A', 'A']
How does python know that a score below 60 == F, score between 60-70 is D, 70-80 is C etc ?