【发布时间】:2018-09-07 02:46:30
【问题描述】:
我有一个字典列表:
lofd = [{'a':'123', 'b':'abc', 'c': {'ca':['1','2'],'cb':['3','4']},'d':{'da':['1','2'], 'db':['1','2']}]
我需要遍历它以将其提取到一个新的数据集中:
new_lofd = [{'a':'123', 'c':{'ca':['1','2'], 'd':{'db':['1','2']}]
如何在循环中访问特定的键/值?
【问题讨论】:
标签: python-3.x loops dictionary nested-lists