# Student becomes teacher 9/9. It says my last two print codes are wrong

#1

Traceback (most recent call last):
File "python", line 51, in
NameError: name 'students' is not defined

``````Replace this line with your code.
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)
average1 = float(total) / len(numbers)
return average1

def get_average(student):
homework = average(student["homework"]) * 0.10
quizzes = average(student["quizzes"]) * 0.30
tests = average(student["tests"]) * 0.60
return homework + quizzes + tests

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_class_average(students):
results = []
for student in students:
results.append(get_average(student))
return average(results)

print get_class_average(students)

#2

in exercise 3 you should have created a list called students, containing all the students. This list is missing in your case, which means when you try to call the functions here:

``````print get_class_average(students)

students is undefined, because the list students is missing (not defined)

#3

Afterward I posted this I edited but it says it's still wrong

students = [lloyd, alice, tyler]
print get_class_average(students)