【发布时间】:2021-09-24 22:12:40
【问题描述】:
"users": {
"673336994218377285": {"votes": 5},
"541388453708038165": {"votes": 1},
"845444326065700865": {"votes": 9}
}
如何根据嵌套字典的“votes”键对字典进行排序?字典应该是这样的:
"users": {
"845444326065700865": {"votes": 9},
"673336994218377285": {"votes": 5},
"541388453708038165": {"votes": 1}
}
【问题讨论】:
-
这能回答你的问题吗? How do I sort a dictionary by value?
标签: python sorting dictionary