def check_ranking(self, p):
    self.populate_ranks_array(ranks_file)
    top5 = self.compare_score(p)
    if top5:
        print('Well Done! You ranked Top 5!')
        print('\nNew Rankings:')
        for i in self.ranks:
            print(((i.name + ' - ') + str(i.score)))
        self.append_file(ranks_file)
    else:
        print("Sorry, your score didn't rank top 5!")
        print('\nCurrent Rankings:')
        for i in self.ranks:
            print(((i.name + ' - ') + str(i.score)))
    self.ranks = []
def check_ranking(self, p):
    self.populate_ranks_array(ranks_file)
    top5 = self.compare_score(p)
    if top5:
        print('Well Done! You ranked Top 5!')
        print('\nNew Rankings:')
        for i in self.ranks:
            print(((i.name + ' - ') + str(i.score)))
        self.append_file(ranks_file)
    else:
        print("Sorry, your score didn't rank top 5!")
        print('\nCurrent Rankings:')
        for i in self.ranks:
            print(((i.name + ' - ') + str(i.score)))
    self.ranks = []