Python – Create Dictionary from List of Tuples

To create a dictionary from list of tuples in Python, where each tuple is of the form (key, value), pass the list of tuples as argument to dict() builtin function.

dict(list of tuples object)

In this example, we will give a list for tuples as argument to dict() function.

Python Program

iterable = [('m', 4), ('p', 8)]
myDictionary = dict(iterable)
Try Online


{'m': 4, 'p': 8}


In this Python Tutorial, we learned how to create a dictionary from a list of tuples using Python dict() builtin function.