Making The Grade - throws type error

In Making The Grade exercise in Python, there are different exercises and I’m having trouble getting past Task 5.

Here is my code:

def student_ranking(student_scores, student_names):
    """Organize the student's rank, name, and grade information in descending order.

    :param student_scores: list - of scores in descending order.
    :param student_names: list - of string names by exam score in descending order.
    :return: list - of strings in format ["<rank>. <student name>: <score>"].
    """
    result_list = []
    if len(student_scores) == len(student_names):
        for index, word in enumerate(student_names):
            numbering_string = str(index + 1)
            index_string = str(word)
            score_string = str(student_scores[index])
            new_string = numbering_string + '. ' + word + ': ' + score_string
            result_list.append(new_string)

    return result_list

When I print the values inside the result_list, it prints as expected. But if I used the return syntax to pass the return list, it shows the error:
TypeError: list indices must be integers or slices, not list

I’m not sure why the error is that when I’m just returning the value and not accessing the items inside. This only occurs when I use the return syntax.

Is that the complete error message or are there more details?

When I use that code, I don’t get that error.

unfortunately, that’s all the details of the error.

i was able to overcome the exercise but i replaced this code (my code) and copied the others others :slightly_frowning_face: coz it still gives the error and i cant push through…

I suspect the error is in a different function. If you share all the code for the exercise, someone might be able to help.