Q:

TypeError: 'top_list' object does not support indexing

I would like to print out the list sorted by the second element.
TypeError: 'top_list' object does not support indexing

Is there anyone that can help me?
class top_list(object):

    def __init__(self, name, hit_rate):
        self.name = name
        self.hit_rate = float(hit_rate)

    def __str__(self):
        return "{0} {1}".format(self.name, self.hit_rate)

def top_ten():

    """Prints out the list"""
    top10 = []
    file = open("high_score.txt")
    for i in range(0,1):
        x = file.readlines()
    for line in x:
        line = line.split(",")
        lista = top_list(line[0], float(line[1]))
        top10.append(lista)

    a = sorted(top10, key=lambda line: line[1])
    print(a)

A:

In your code
a = sorted(top10, key=lambda line: line[1])

you are trying to access the top_list element using subscript notation. If that is what you want to do, implement a __getitem__ method. __getitem__ allows you to use the subscript operator - list[1] translates to list.__getitem__(1).
def self.__getitem__(self, key):
    if key == 1:
        return self.name
    else:
        return self.hit_rate

Or modify the lambda function to access the element you want without using a subscript:
a = sorted(top10, key=lambda line: line.hit_rate)

Also note that using context manager for file is safer and more pythonic. You can also read the lines by iterating over the Python file object:
with open('high_score.txt', 'r') as file:
    for line in file:
        ...

but extra caution needs to be taken to handle newlines (stripping them possibly).

