【发布时间】:2018-10-04 02:00:36
【问题描述】:
我有一件简单的事情,但由于某种原因,我的思维现在被阻塞了 这种数据叫什么名字
[{'self': 'test', 'id': 4, 'name': 'IT Network Support'}, {'self': 'tes_1', 'id': 5, 'name': 'IT PC Support'}]
如何将它们分成 2 个字典
它也可以是动态的并更改为
[{'self': 'test', 'id': 4, 'name': 'IT Network Support'}, {'self': 'tes_1', 'id': 5, 'name': 'IT PC Support'} ,{'self': 'tes_2', 'id': 6, 'name': 'IT Voice Support'} ]
我想要一个动态的解决方案
【问题讨论】:
-
我不清楚你想要的结果是什么。你想要一本字典吗? Python 确实不允许动态分配不同数量的变量。
标签: python dictionary