の辞書のソート・リスト

免責事項:この記事はブロガーオリジナル記事です、続くBY-SAのCC 4.0を著作権契約、複製、元のソースのリンクと、この文を添付してください。
このリンク: https://blog.csdn.net/weixin_44266650/article/details/100539147
dd = [
    {
      "00:00-00:30": 4869
    }, 
    {
      "00:30-01:00": 5652
    }, 
    {
      "01:00-01:30": 4935
    }, 
    {
      "01:30-02:00": 5033
    },
    {
      "23:00-23:30": 5528
    }, 
    {
      "23:30-00:00": 6530
    }
  ]

from operator import itemgetter
a =  {key: value for x in dd for key, value in x.items()}
print(sorted(a.items(), key=itemgetter(1),reverse=True)[0])

おすすめ

転載: blog.csdn.net/weixin_44266650/article/details/100539147