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 = 0

total += sum(numbers)

total = float(total) / len(numbers)

return total

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)

def get_letter_grade(student):

if type(student) == dict :

if get_average(student) >= 90:

grade = "A"

elif get_average(student) >= 80:

grade = "B"

elif get_average(student) >= 70:

grade = "C"

elif get_average(student) >= 60:

grade = "D"

else:

grade = "F"

return grade

elif type(student) == float or type(student) == int:

if student >= 90:

grade = "A"

elif student >= 80:

grade = "B"

elif student >= 70:

grade = "C"

elif student >= 60:

grade = "D"

else:

grade = "F"

return grade

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)

print get_letter_grade(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