Please help me with this exercies I am stuck at this point


Need help with this exercies plz If run this code it will show this error: string indices must be integers, not str . This is link of my code .

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

Replace this line with your code.


why use a loop? The purpose of get_average is calculate the weighted average grade of a single student, your function parameter is student (single) not students (plural)


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