# 9/9 How is everybody doing?

#1

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 = 0
total += sum(numbers)
total = float(total) / len(numbers)
def get_average(student):
homework = average(student[“homework”])
quizzes = average(student[“quizzes”])
tests = average(student[“tests”])
return (homework * 0.1) + (quizzes * 0.3) + (tests * 0.6)

if type(student) == dict :
if get_average(student) >= 90:
elif get_average(student) >= 80:
elif get_average(student) >= 70:
elif get_average(student) >= 60:
else:

elif type(student) == float or type(student) == int:
if student >= 90:
elif student >= 80:
elif student >= 70:
elif student >= 60:
else:

class_list = [lloyd, alice, tyler]

def get_class_average(class_list):
results = []
for student in class_list:
stu_avg = get_average(student)
results.append(stu_avg)

return average(results)

numeric_total = (get_class_average(class_list))
print get_class_average(class_list)

**Can i done this like that? I’m seriously overclocking my brain lol **
It gives an error, but the results are correct. It’s because the name’s function i used? And the def get_letter_grade(student) it’s a little bit different. It’s why ??

Thanks a lot

#2

Taking liberties with lessons will have consequences. Follow the instructions to the letter for best results. What you do on your own for experimentation and extended learning is not meant to be done in the course framework. The SCT is not very broad in focus and can only accept what is expected.

#3

When asking about an error on the discussion forums, it is always a good practice to report the contents of the error message.

#4

Thanks a lot for your answer. It help solve my problem, and i understand now.
Yes, probably i should maintain between the exercise guidelines. It should solve future doubts.

#5

Sure, i’ll keep it in mind for next post.