[3.13] gh-145269: simplify bisect.bisect doc example (GH-145270) by miss-islington · Pull Request #145368 · python/cpython
>>> def grade(score, breakpoints=[60, 70, 80, 90], grades='FDCBA'): ... i = bisect(breakpoints, score) ... return grades[i] >>> def grade(score) ... i = bisect([60, 70, 80, 90], score) ... return "FDCBA"[i] ... >>> [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]] ['F', 'A', 'C', 'C', 'B', 'A', 'A']