qq = {"a": [1, 2, 3, 4, 5], "b": [6, 7, 8], "c": [9, 10]}
q =sorted(qq.items(), key=lambda d:len(d[1]), reverse=True)
print(q)
qq = {"a": [1, 2, 3, 4, 5], "b": [6, 7, 8], "c": [9, 10]}
q =sorted(qq.items(), key=lambda d:len(d[1]), reverse=True)
print(q)
本文标题:2019-02-12:字典倒序排列
本文链接:https://www.haomeiwen.com/subject/yjjkeqtx.html
网友评论