Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Ryerson Letter Grade by kazuki.h
TABLE = {
(85,89): "A",
(80,84): "A-",
(77,79): "B+",
(73,76): "B",
(70,72): "B-",
(67,69): "C+",
(63,66): "C",
(60,62): "C-",
(57,59): "D+",
(53,56): "D",
(50,52): "D-"
}
def ryerson_letter_grade(pct: int) -> str:
if 89 < pct:
return "A+"
elif pct < 50:
return "F"
else:
for scale in TABLE.keys():
if scale[0] <= pct <= scale[1]:
return TABLE[scale]
May 6, 2021