Skip to content
On this page

sort_by_value

根据字典的value排序

python
from usepy import sort_by_value

参数

  • original_dict: 要排序的字典
  • az: 排序方式,默认为True,表示升序

例子

python
>>> sort_by_value({'c': 1, 'b': 2, 'a': 3})
{'c': 1, 'b': 2, 'a': 3}

Released under the MIT License.