You are viewing a single comment's thread. Return to all comments →
Python
def comparator(a, b): # First, sort by descending score. if a.score > b.score: return -1 elif a.score < b.score: return 1 else: # If scores are equal, sort by ascending name. if a.name < b.name: return -1 elif a.name > b.name: return 1 else: return 0
Seems like cookies are disabled on this browser, please enable them to open this website
Sorting: Comparator
You are viewing a single comment's thread. Return to all comments →
Python