How is everybody doing?


#1


How is everybody doing?

Hello i have been stuck on this for a while now and can't find my error. The error code is : Oops, try again. Did you remember to print the average of the class? It looks like "83.8666666667" wasn't printed.


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) 
    total = float(total)
    total = total / len(numbers)
    
    return total
    
def get_average(students):
    
    homework = average(students["homework"]) * 0.1
    quizzes = average(students["quizzes"]) * 0.3
    tests = average(students["tests"]) * 0.6
    
    return homework + quizzes + tests
    
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"
                            
                            
                            
print get_letter_grade(get_average(tyler))

def get_class_average(students):
    
    results = []
    
    for student in students:
        results.append(get_average(student))
        
    return average(results)
  
    
    print get_class_average(students)
    print get_letter_grade(get_class_average(students))


#2

These two lines have indentation which puts them inside the function block above them. Remove indentation.


#3

I have removed the indentations and still getting the same error come up.


#4

Does it ask us to print the class's letter grade? Maybe just print the class average.


#5

I'm getting the same error, yet the results show the class average and the class grade. My class average will show just 83, not the percentage yet for some odd reason the "checker" wants the exact number.


#7

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