I'm attempting to convert multiple lists into a dictionary where the initial list contains the keys.
For example:
list_keys = ['a' , 'b']
list_vals_1 = ['tick' , 'tack']
list_vals_2 = ['big' , 'small']
is transformed into:
expected = {}
expected['a'] = ('tick' , 'big')
expected['b'] = ('tack', 'small')
print('expected' , expected)
I could transform the lists using into a dictionary using:
mappings = {}
i = 0
for l in list_keys :
mappings[l] = (list_vals_1[i] , list_vals_2[i])
i = i + 1
Is there a cleaner/better solution using Python to accomplish this ?