将两个list列表对象转为dict字典对象
代码示例
keys = ['one', 'two', 'three']
values = [1, 2, 3]
dct = dict(zip(keys, values))
print(dct)
# {'one': 1, 'two': 2, 'three': 3}
参考文章
标签:zip,Python,three,列表,对象,dict,字典 From: https://blog.51cto.com/mouday/6508866
将两个list列表对象转为dict字典对象
代码示例
keys = ['one', 'two', 'three']
values = [1, 2, 3]
dct = dict(zip(keys, values))
print(dct)
# {'one': 1, 'two': 2, 'three': 3}
参考文章
标签:zip,Python,three,列表,对象,dict,字典 From: https://blog.51cto.com/mouday/6508866