Created
July 11, 2018 05:22
-
-
Save hashware/cd0e4e9ab04bf6bc448c2a02e827f51a 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
def sort_dict(dict_words): | |
""" | |
字典排序 | |
:param dict_words: | |
:return: | |
""" | |
keys = dict_words.keys() | |
values = dict_words.values() | |
list_one = [(key, val) for key, val in zip(keys, values)] | |
list_sort = sorted(list_one, key=lambda x: x[1], reverse=True) | |
return list_sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment