Python Programming - Dictionaries - Discussion

Discussion Forum : Dictionaries - General Questions (Q.No. 40)
40.
How do you create a dictionary with keys from one list and values from another list?
dict(keys, values)
dict.fromkeys(keys, values)
{key: value for key, value in zip(keys, values)}
dictionary.create(keys, values)
Answer: Option
Explanation:
Using a dictionary comprehension with zip() can create a dictionary with keys from one list and values from another.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.