Created
September 1, 2021 18:00
-
-
Save gchavez2/2fab22677cd8797aec2e7ac102464a55 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
for k,v in sorted(foo.items()): | |
print k, v | |
for k in sorted(foo.keys()): | |
print k, foo[k] | |
More at: https://stackoverflow.com/questions/364519/in-python-how-do-i-iterate-over-a-dictionary-in-sorted-key-order |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment