Last active
April 2, 2017 17:01
-
-
Save killown/e6608dc9fd51e80e614fa8d20cb39fe0 to your computer and use it in GitHub Desktop.
Sort Dict
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
#!/usr/bin/env python3 | |
import operator | |
x = {1: 2, 3: 4, 4: 3, 2: 1, 0: 0} | |
sorted_x = sorted(x.items(), key=operator.itemgetter(1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment