列表转字典
it = [1,2,3,4]
print(dict(zip(it, it)))
# {1: 1, 2: 2, 3: 3, 4: 4}
it = iter(it)
print(dict(zip(it, it)))
# {1: 2, 3: 4}
列表转字典
it = [1,2,3,4]
print(dict(zip(it, it)))
# {1: 1, 2: 2, 3: 3, 4: 4}
it = iter(it)
print(dict(zip(it, it)))
# {1: 2, 3: 4}
转载于:https://www.cnblogs.com/lianzhilei/p/9959929.html