python - 如何将字典列表拆分为单独的字典?
问题描述
如何将字典列表拆分为单独的字典?
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}
解决方案
dict_1, dict_2 = dict_example
.
推荐阅读
- javascript - 使用 serializeJSON 从 HTML 表单格式化 JavaScript 对象
- artificial-intelligence - 在 Jason 中使用 AgentSpeak 创建英语拍卖
- build - VS2017 Build Explorer 仅显示最后 7 个构建——如何扩展?
- sql - 使用 R 一次将多条记录插入 Redshift
- r - 删除第一个值ggplot下的空间
- vim - 如何在vim的列表中添加引号beetwen单词?
- javascript - jquery validate - 表单不记得自动完成的输入文本
- mongodb - $arrayElemAt 的第一个参数必须是一个数组
- uml - UML 关联意义
- eclipse - EGit 中“切换到”的目的是什么?