0
点赞
收藏
分享

微信扫一扫

Python字典排序


dict1 = {'a': 5, 'b': 3, 'c': 6}
sorted_dict = dict(sorted(dict1.items(), key=lambda x: x[1]))
print(sorted_dict)


举报

相关推荐

0 条评论