Merge two lists,one as keys, one as values, into a dict in Python
dictionary, list, python
Solution
Seems like this should work, though I guess it's not one single function:
dict(zip(["key1","key2","key3"], ["val1","val2","val3"]))
from here: How do I combine two lists into a dictionary in Python?
Problem
Is there any build-in function in Python that merges two lists into a dict? Like: ``` combined_dict = {} keys = ["key1","key2","key3"] values = ["val1","val2","val3"] for k,v in zip(keys,values): combined_dict[k] = v ``` Where: `keys` acts as the list that contains the keys. `values` acts as the list that contains the values There is a function called array_combine that achieves this effect.