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


#1



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 .

https://www.codecademy.com/en/courses/python-beginner-en-qzsCL/1/2?curriculum_id=4f89dab3d788890003000096

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.


#2

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)


#3

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