Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
for line in TABLE solution in Clear category for Ryerson Letter Grade by karlian
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 TABLE.strip().splitlines():
grade, range = line.split()
start, end = int(range[0:2]), int(range[3:5])
if grade == "A" and pct > end:
return "A+"
elif start <= pct <= end:
return grade
return "F"
June 23, 2022
Comments: