Hi there, having some difficulty with this letter grades exercise on the Python track. I’ve built a piece of code which by and large does what is asked, but I’m facing some sort of rounding issue which is causing the test to fail. Not being an American, I’m not entirely clear how grade boundaries are rounded in the US, and the question doesn’t offer any hints on this.
def letter_grades(highest):
def thresh(ratio):
return round(((highest-40)*ratio)+40)
return [thresh(0),thresh(0.25),thresh(0.5),thresh(0.75)]
The rounded result is often one too low, but not always. I’ve attempted to replace that with math.ceil before as well but with simply a different rounding error from that. Any idea what I’m doing wrong here?
On a funny note, I used to be a university lecturer here in the UK and had to do a similar problem in excel at the time. We don’t shift grade boundaries but I did have to convert numerical scores to letters en masse.