📌  相关文章
📜  在 python 代码示例中按值对字典进行排序

📅  最后修改于: 2022-03-11 14:45:08.035000             🧑  作者: Mango

代码示例4
#for dictionary d
sorted(d.items(), key=lambda x: x[1]) #for inceasing order
sorted(d.items(), key=lambda x: x[1], reverse=True) # for decreasing order
#it will return list of key value pair tuples