We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
i did not understand about your function:
'''
def comparator(a, b):
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
'''
can you send me any link to understand it well
Sorting: Comparator
You are viewing a single comment's thread. Return to all comments →
wow your comparator function work wonderful.
i did not understand about your function: ''' def comparator(a, b): 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 ''' can you send me any link to understand it well