Just Weight and See



I run my code and it appears to be calculating correctly, but I get the following error when I run my code. How do I round it to 2dp?

get_average(alice) returned [91.14999999999999] instead of the expected 91.15

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


your grade should be an integer, not a list


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