首页 > 解决方案 > 如何将字典列表拆分为单独的字典?

问题描述

如何将字典列表拆分为单独的字典?

dict_example = [{'limited': 1, 'all': 16, 'concept': 1, 'secondly': 1}, {'hello': 3, 'bye': 6}]

所需的输出:

dict_1: {'limited': 1, 'all': 16, 'concept': 1, 'secondly': 1}
dict_2: {'hello': 3, 'bye': 6}

标签: pythondictionaryunnest

解决方案


dict_1, dict_2 = dict_example.


推荐阅读