You are viewing a single comment's thread. Return to all comments →
Note that all the elses are unecesary since you're exiting the function at each if statement. Mine was:
if a.score > b.score: return -1 if a.score < b.score: return 1 if a.name > b.name: return 1 if a.name < b.name: return -1 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 →
Note that all the elses are unecesary since you're exiting the function at each if statement. Mine was: