# Need help on this one

#1

I do not know why it keep showing this error.

Oops, try again. One of the following is missing or broken when we tried to use it: alice, lloyd, tyler, students, get_class_average, get_letter_grade

My code is as follow:

``````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]
}

def average(numbers):
total = sum(numbers)
result = float(total) / len(numbers)
return result

# Another Function
def get_average(student):
homework = sum(student["homework"]) / len(student["homework"])
quizzes = sum(student["quizzes"]) / len(student["quizzes"])
tests = sum(student["tests"]) / len(student["tests"])
result = (0.1*homework) + (0.3*quizzes) + (0.6*tests)
return result

student_names = [lloyd,alice,tyler]

if score >= 90:
return "A"
elif score >= 80:
return "B"
elif score >= 70:
return "C"
elif score >= 60:
return "D"
else:
return "F"

# Get average of overall students
def get_class_average(students):
results = []
for student in students:
avg = get_average(student)
results.append(avg)
return average(results)

print get_class_average(student_names)

The result of the code:

83.8666666667
B
None

#2

Output looks right. I think Codecademy just wants your list of students to be called students instead of student_names.

#3

Great! That's Works! Thank you.

#4

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