How to convert two lists into a dictionary python

Method 1

keys = ['a', 'b', 'c']
values = [1,2,3]
x = dict()
for i in range(len(keys)):
	x[keys[i]] = values[i]
return x

Method 2

List_1= ['a', 'b', 'c']
List_2=[1,2,3]
d=dict(zip(List_1, List_2))

Method 3

List_1 = ['a', 'b', 'c']
List_2 = [1, 2, 3]
d = {(List_1[i], List_2[i]) for i in range(len(List_1))}

Execution time test

import timeit


def method_1():
    keys = ['a', 'b', 'c']
    values = [1, 2, 3]
    x = dict()
    for i in range(len(keys)):
        x[keys[i]] = values[i]
    return x


def method_2():
    List_1 = ['a', 'b', 'c']
    List_2 = [1, 2, 3]
    d = dict(zip(List_1, List_2))
    return d


def method_3():
    List_1 = ['a', 'b', 'c']
    List_2 = [1, 2, 3]
    d = {(List_1[i], List_2[i]) for i in range(len(List_1))}
    return d


def main():
    time = timeit.repeat(lambda: method_1())
    print("Method 1 time - ", time)
    time = timeit.repeat(lambda: method_2())
    print("Method 2 time - ", time)
    time = timeit.repeat(lambda: method_3())
    print("Method 3 time - ", time)


if __name__ == "__main__":
    main()

Result

Method 1 time -  [0.8707655000000001, 0.8447060000000001, 0.9333172000000001, 0.8381554000000002, 0.8381263000000003]
Method 2 time -  [0.7485241999999994, 0.6857407000000002, 0.6767974999999993, 0.6697913, 0.6683062]
Method 3 time -  [1.0162262000000002, 1.1051707000000004, 1.1231422999999996, 1.1826024999999998, 1.2012918]

You can see that method 2 (dict(zip(List_1, List_2))) is the fastest.