Skip to content

Instantly share code, notes, and snippets.

@gchavez2
Created September 1, 2021 18:00
Show Gist options
  • Save gchavez2/2fab22677cd8797aec2e7ac102464a55 to your computer and use it in GitHub Desktop.
Save gchavez2/2fab22677cd8797aec2e7ac102464a55 to your computer and use it in GitHub Desktop.
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