Python 递归地将(标签、列表)对转换为字典

Python 递归地将(标签、列表)对转换为字典,python,dictionary,zip,iteration,Python,Dictionary,Zip,Iteration,我有一个数据结构,目前的格式是嵌套字符串和对应于所述字符串的列表,例如: 'Document types' ['Surveys and overviews', 'Reference works', 'General conference proceedings', 'Biographies', 'General literature', 'Computing standards, RFCs and guidelines'] 'Cross-computing tools and technique

我有一个数据结构,目前的格式是嵌套字符串和对应于所述字符串的列表,例如:

'Document types'
['Surveys and overviews', 'Reference works', 'General conference proceedings', 'Biographies', 'General literature', 'Computing standards, RFCs and guidelines']
'Cross-computing tools and techniques
['Reliability', 'Empirical studies', 'Measurement', 'Metrics', 'Evaluation', 'Experimentation', 'Estimation', 'Design', 'Performance', 'Validation', 'Verification']
其中,每个列表可以是字符串列表(即基本大小写和最深级别)或另一系列标签列表对

我已经开发了转换最顶层的代码,但是找不到一种方法让它迭代或递归地在下面的层上执行操作

到目前为止,我的代码是:

  def recursive(self, data):
    for label, tags in zip(*[iter(data)]*2):
      self.newData[label] = tags

    return self.newData
输入结构示例:

您的数据结构是json吗?好奇你是如何标记等级的?这是Pycharm字典视觉视图的屏幕截图:-)