Here, I used my existing logical turtle and added a functinal part to it. I embedded the following code into the logical turtle to display the grade based on the score.
def computegrade(score):
  if score >= 9 :
    return 'A'
  elif score >= 7 :
    return 'B'
  elif score >= 5 :
    return 'C'
  elif score >= 3 :
    return 'D'
  elif score < 1 :
    return 'F'