【发布时间】:2017-06-21 05:31:22
【问题描述】:
我有一个这样的字符串列表
["['List one', 'F, U','P']",
"['List Two', 'J, C, D,I']",
"['List Three', 'W']",
"['List Four', 'Y, B','E, H, M','L, N']"]
我会列出将其转换为这样的字典列表
{
List One: ['F','U','P'],
List Two: ['J','C','D','I'],
List Three: ['W'],
List Four: ['Y', 'B','E','H','M','L', 'N']
}
我找到了类似的例子,但没有足够接近的例子
【问题讨论】:
-
更新答案以匹配最新的问题变化
标签: python python-3.x data-structures