Pls help, don't know what i did wrong, Sending A Letter


#1



https://www.codecademy.com/courses/python-beginner-en-qzsCL/1/3?curriculum_id=4f89dab3d788890003000096#


Traceback (most recent call last):
File "python", line 37, in
File "python", line 22, in average
TypeError: unsupported operand type(s) for +: 'int' and 'str'


lloyd = {
    "name": "Lloyd",
    "homework": [90.0, 97.0, 75.0, 92.0],
    "quizzes": [88.0, 40.0, 94.0],
    "tests": [75.0, 90.0]
}
alice = {
    "name": "Alice",
    "homework": [100.0, 92.0, 98.0, 100.0],
    "quizzes": [82.0, 83.0, 91.0],
    "tests": [89.0, 97.0]
}
tyler = {
    "name": "Tyler",
    "homework": [0.0, 87.0, 75.0, 22.0],
    "quizzes": [0.0, 75.0, 78.0],
    "tests": [100.0, 100.0]
}

# Add your function below!
def average(numbers):
    total = sum(numbers)
    total = float(total)
    total = total / len(numbers)
    return total
def get_letter_grade(score):
    if score >= 90.0:
        return "A"
    elif score >= 80.0:
        return "B"
    elif score >= 70.0:
        return "C"
    elif score >= 60.0:
        return "D"
    else:
        return "F"
print get_letter_grade(average(lloyd))


I just don't understand where I went wrong.


#2

here:

print get_letter_grade(average(lloyd))

average() is a function you build to get the average of a list of numbers, are you sure you not indented to use get_average here? which calculate a student average grade


#3

I did that, and I get this error:
Traceback (most recent call last):
File "python", line 37, in
NameError: name 'get_average' is not defined


#4

you build get average in the previous exercise, where did it go?


#5

Oh, for some reason it skipped that exercise, I'll do it and try again, thanks!


#6

don't skip in this section (students become teachers), everything you build you need in the final exercise


#7

Added get average, works now, thanks for the help!


#8