so i have a project due in my computer programming class and i need some serious help. we are learning about recursive sorting, such as merge sort, selection sort, etc.
my project has to do with taking 10 people and sorting them in order by their names (alpabetically), rank (numerically), country (alphabetically), and the amount of games they have played (numerically).
so far, this is my code.
class Players:
def __init__(self, name, rank, tournamentsPlayed, country):
self.name = name
self.rank = rank
self.tournamentsPlayed = tournamentsPlayed
self.country = country
def __repr__(self):
return repr((self.name, self.rank, self.tournamentsPlayed, self.country))
def __init__(self):
self.Players = []
self.Players.append = ("Roger Federer", 1, 18, "SUI")
self.Players.append = ("Novak Djokovic", 2, 21, "SRB"),
self.Players.append = ("Rafael Nadal", 3, 17, "ESP"),
self.Players.append = ("Juan Martin Del Potro", 4, 18, "ARG"),
self.Players.append = ("Andy Murray", 5, 17, "GBR"),
self.Players.append = ("Nikolay Davydenko", 6, 25, "RUS"),
self.Players.append = ("Robin Soderling", 7, 25, "SWE"),
self.Players.append = ("Andy Roddick", 8, 20, "USA"),
self.Players.append = ("Fernando Verdasco", 9, 26, "ESP"),
self.Players.append = ("Jo-Wilfried Tsonga", 10, 25, "FRA")
i know it still needs a lot of work. any help would be much appreciated. thanks in advance.