# 9. How is everybody doing? Error

#1

"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"

Here's my code:
I don't understand how something can be "broken" if I am getting some values in the console that seem to be correct

``````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)
return float(total) / len(numbers)

def get_average(student):
homework = average(student["homework"])
quizzes = average(student["quizzes"])
tests = average(student["tests"])
return homework*.1 + quizzes*.3 + tests*.60

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([lloyd, alice, tyler])

#2

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

Because it says in instruction to print out the result of calling get_class_average with your students list and your students should be [lloyd, alice, tyler].

#3

As with the comment above.

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

#4

I am also having this issue. I tried @cssmaster23105 cssmasterâs code and it threw the same error. Also, the lesson does ask for the last line to be a variation of:
`print get_letter_grade(get_class_average(students))`
and not:
`print get_letter_grade(students)`
as they suggested.

#5

plssss i need the code ! HELPPP MEEEEE! i give up! i canât and i canât find the solution ! plss helpp mee i need finish!!

#6

Add the following syntax, assuming youâre on step 9 and youâve passed the previous steps.

``````#define the list
students = [lloyd, alice, tyler]

#get the class average
print get_class_average(students)

#print the letter grade associated with the average from above
``````

#7

yeah! i have this in my code ! but still dont work:

this is my 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)
return float(total) / len(numbers)

def get_average(student):
homework = average(student[âhomeworkâ])
quizzes = average(student[âquizzesâ])
tests = average(student[âtestsâ])
weighted = (homework * 0.1) + (quizzes * 0.3) + (tests * 0.6)
return weighted

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:
new_average = get_average(student)
results.append(get_average(student))
return average(results)

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

#8

Try this, itâs my exact syntax.

``````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)
total = float(total)
total = total / len(numbers)

def get_average(student):
return float(average(student["homework"]) * 0.1) + \
float(average(student["quizzes"]) * 0.3) + \
float(average(student["tests"]) * 0.6)

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 each in students:
results.append(get_average(each))
return average(results)

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

#9

OMG damntâŚ nothing!..the code donât workâŚ

#10

Really? I literally just hit accept and it passedâŚ

#11

really let me show you!!!
hahha i canât beliveâŚ
this never happend me before!!

#12

Sorry friend. Not sure why it isnât working for you when it does for me.

#13

omg bro! thanks so much! i think maybe is â â â â â â â  problem with the console or the navigatorâŚidkâŚ
thanks for your time my friend!
i will make a â â â â â â â  post to codecademyâŚ

#14

@ritterc 's code does work! I tried it and found that if there were white spaces before code, it wonât work, so try another time, youâll pass

#15

an alternate code that I used to pass because I seem to get a lot of errors when my code looks like some of the recommended codes is:

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]
}
students = [lloyd, alice, tyler]

def average(numbers):
total = sum(numbers)
new_total = float(total)
return new_total / len(numbers)
def get_average(student):
homework = average(student[âhomeworkâ])
quizzes = average(student[âquizzesâ])
tests = average(student[âtestsâ])
sum = homework * .1 + quizzes * .3 + tests * .6
return sum
if score >= 90:
return âAâ
elif score >= 80:
return âBâ
elif score >= 70:
return âCâ
elif score >= 60:
return âDâ
else:
return âFâ
print score.get_average(students)

def get_class_average(students):
results =
for x in students:
results.append(get_average(x))
return average(results)
total_n = get_class_average(students)
print total_n

just make to indent properly

#16

It looks different than the strange behavior everyone else is having but I was having lots of trouble with this lesson too and it seemed to take me forever to figure out:
students = [âlloydâ, âaliceâ, âtylerâ]

This is wrong; there should not be quotes around the student list; it should be:
students = [lloyd, alice, tyler]

hope that helps someone