Now let’s write a
get_letter_grade function that takes a number
score as input and returns a string with the letter grade that that student should receive.
Define a new function called
get_letter_grade that has one argument called
score to be a number.
Inside your function, test
score using a chain of
if: / elif: / else: statements, like so:
- If score is 90 or above:
- Else if score is 80 or above:
- Else if score is 70 or above:
- Else if score is 60 or above:
Finally, test your function!
Print the resulting letter grade with
get_letter_grade function and pass in