-
-
Save IndhumathyChelliah/8f6c0ea0dba1635a8f02cad0299932e4 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
from operator import itemgetter | |
d={'a':[1,2,9],'b':[3,2,5],'c':[1,1,2]} | |
#Sorted based on second element, then based on third element | |
print (sorted(d.values(),key=itemgetter(1,2))) | |
#Output:[[1, 1, 2], [3, 2, 5], [1, 2, 9]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment