Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
No, thanks. solution in Clear category for Ryerson Letter Grade by veky
TABLE = '''
A 85-89%
A- 80-84%
B+ 77-79%
B 73-76%
B- 70-72%
C+ 67-69%
C 63-66%
C- 60-62%
D+ 57-59%
D 53-56%
D- 50-52%
'''
def ryerson_letter_grade(pct: int) -> str:
for line in filter(None, TABLE.splitlines()):
grade, range = line.rstrip('%').split()
down, up = map(int, range.split('-'))
if down <= pct <= up: return grade
return 'A+' if pct >= 90 else 'F'
Oct. 12, 2018