python 2列表到字典(一个列表带键,另一个带值)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 2列表到字典(一个列表带键,另一个带值)相关的知识,希望对你有一定的参考价值。

host_dict_keys = table_data[0]
host_info = {}
  for i, row in enumerate(table_data):
      if i == 0:
          continue
      host_info = dict(zip(host_dict_keys, row)) # Combine lists to create dict

以上是关于python 2列表到字典(一个列表带键,另一个带值)的主要内容,如果未能解决你的问题,请参考以下文章