How is Everybody Doing?


#1


Hi guys,

I have a strange problem on How is Everybody Doing step. I have write the related code eventhrough i got the output, it says something missing and i could not figure it out. Could you please take look to the code below and share with me what is missing?

Thank you and have a great day!


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"]
# Add your function below!
def average(numbers):
    total = float(sum(numbers))
    total = total / len(numbers)
    return total
    
def get_average(alice):
    homework = average(alice["homework"])
    quizzes = average(alice["quizzes"])
    tests = average(alice["tests"])
    total = 0.1 * homework + 0.3 * quizzes + 0.6 * tests
    
    return total
        
def get_letter_grade(score):
    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 key in students:
        get = get_average(key)
        results.append(get)
    return average(results)
    
print get_letter_grade(get_class_average([lloyd, alice, tyler]))


#2

Remove the quotes so the list items are identifiers, not strings.


#3

You're just awesome! Thank you i could not see whole hour!


#4

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