I have this code and I would like to write it in a list comprehension
list1 = ["A", "B", "C"]
list2 = [1, 2, 3]
my_dict = {}
y = 0
for x in list1:
my_dict[x] = list2[y]
y=y+1
print (my_dict)
I have this code and I would like to write it in a list comprehension
list1 = ["A", "B", "C"]
list2 = [1, 2, 3]
my_dict = {}
y = 0
for x in list1:
my_dict[x] = list2[y]
y=y+1
print (my_dict)