Troubled, please help


#1



def get_average(lloyd):
    homework = average(lloyd["homework"])
    quizzes = average(lloyd["quizzes"])
    tests = average (lloyd["tests"])
    return 0.1 * homework +  0.3 * quizzes +  0.6 * tests
    score = get_average(lloyd)
    def get_letter_grade(score):
            if score >= 90:
                return "A"
            elif score >= 80:
                return "B"
            elif score >= 70:
                return "C" 
            elif score >= 60:
                return "D"
            else:
                return "F"
            print get_letter_grade(score)


#2

get_letter_grade should be after get_average, not inside the get_average function

this function call:

score = get_average(lloyd)

should also be outside the function, given function calls execute the function


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.