Get grade letter

Define a function get_grade_letter that receives a score and you should return:

'A' if the score is 90 or above

'B' if the score is 80 to 89

'C' if the score is 70 to 79

'D' if the score is 60 to 69

'F' if the score is less than 60

Examples:

>>> get_grade_letter(93)
'A'
>>> get_grade_letter(80)
'B'
>>> get_grade_letter(75)
'C'
>>> get_grade_letter(67)
'D'
>>> get_grade_letter(42)
'F'

Test Cases

test A score - Run Test

def test_A_score():
    assert get_grade_letter(93) == 'A'

test C score - Run Test

def test_C_score():
    assert get_grade_letter(75) == 'C'

test F score - Run Test

def test_F_score():
    assert get_grade_letter(42) == 'F'

test D score - Run Test

def test_D_score():
    assert get_grade_letter(67) == 'D'

test B score - Run Test

def test_B_score():
    assert get_grade_letter(80) == 'B'

Solution 1

def get_grade_letter(score):
    if score >= 90:
        return 'A'
    elif score >= 80:
        return 'B'
    elif score >= 70:
        return 'C'
    elif score >= 60:
        return 'D'
    else:
        return 'F'
def get_grade_letter(score): pass