Created
March 20, 2020 17:33
-
-
Save xkumiyu/129becc88f44ce3004c8c245fecafca7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sort, lambda | |
A.sort(key=lambda x: x[1]) | |
# sort, itemgetter | |
from operator import itemgetter | |
A.sort(key=itemgetter(1)) | |
# sorted, lambda | |
A = sorted(A, key=lambda x: x[1]) | |
# sorted, itemgetter | |
from operator import itemgetter | |
A = sorted(A, key=itemgetter(1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment