I'm writing a soccer league program and I want to sort the table before printing it out. Each team is a member of a class with certain attributes and so far I've been able to sort the integer attributes correctly.
for team in sorted(teams, key=attrgetter("points", "goalDiff", "scored", "name"), reverse = True):
I want all the attributes except name to be reversed, is there a possible way to "un-reverse" the name attribute in this line of code or do I have to take on a different approach?