在Python中,如何通过内部dict中的键对字典中的dict排序

ens*_*are 0 python dictionary

我有一个键/值形式的数据集:

setlist = {{'135350258120342034': {'title':'The Matrix'}
          {'235350258120342034': {'title':'The Godfather'}
          {'335350258120342034': {'title':'Atonement'}
          }
Run Code Online (Sandbox Code Playgroud)

如何按“键”的值对集合列表排序,“键”是字典中的一个字典?

Kab*_*bie 5

>>> sorted(setlist.items(),key=lambda x:x[1]['title'])
[('335350258120342034', {'title': 'Atonement'}), ('235350258120342034', {'title': 'The Godfather'}), ('135350258120342034', {'title': 'The Matrix'})]
Run Code Online (Sandbox Code Playgroud)