Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created June 24, 2020 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndhumathyChelliah/5a65a05960acfc59c3da5c2f192261cb to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/5a65a05960acfc59c3da5c2f192261cb to your computer and use it in GitHub Desktop.
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