Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import bisect
# very useful for the following kind of data:
# https://taxfoundation.org/2016-tax-brackets/
cuts = [60, 70, 80, 90]
grades = 'FDCBA'
[grades[bisect.bisect(cuts, score)] for score in [32, 64, 70, 85, 90, 99, 100]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment