Is there a built-in function in Python that combines two lists in a dict? How:
combined_dict = {} keys = ["key1","key2","key3"] values = ["val1","val2","val3"] for k,v in zip(keys,values): combined_dict[k] = v
Where:
keys
acts like a list containing keys.
values
acts like a list containing values
There is an array_combine function that achieves this effect.
source share