-
-
Save IndhumathyChelliah/5a65a05960acfc59c3da5c2f192261cb 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
l1=[(1,2,3),(4,2,0),(2,1,7)] | |
#Sorting based on second element, id second element is equal means then sorting based on third element. | |
print (sorted(l1,key=lambda x:x[1:3])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment