Just call dict()
on the list of tuples directly
>>> my_list = [('a', 1), ('b', 2)]
>>> dict(my_list)
{'a': 1, 'b': 2}
More Related Contents:
- Why can’t I use a list as a dict key in python?
- Converting a list of tuples into a dict
- Why can’t I use a list as a dict key in python? Exactly what can and cannot be used, and why?
- In what case would I use a tuple as a dictionary key? [closed]
- how do I make two dictionary keys with value as list [closed]
- How to name a file using a value in a list in a dictionary?
- What’s the difference between lists and tuples?
- How do I initialize a dictionary of empty lists in Python?
- How to return dictionary keys as a list in Python?
- In Python, when to use a Dictionary, List or Set?
- python filter list of dictionaries based on key value
- How can I access the nested data in this complex JSON, which includes another JSON document as one of the strings?
- How do I combine two lists into a dictionary in Python? [duplicate]
- Converting list of tuples into a dictionary
- [] and {} vs list() and dict(), which is better?
- What is the inverse function of zip in python? [duplicate]
- How to find the maximum value in a list of tuples? [duplicate]
- python tuple to dict
- Sorting a dictionary with lists as values, according to an element from the list
- How do I serialize a Python dictionary into a string, and then back to a dictionary?
- Group by multiple keys and summarize/average values of a list of dictionaries
- Convert list of strings to dictionary
- How to flatten a tuple in python
- Using a dict to translate numbers to letters in python
- How can I make a dictionary (dict) from separate lists of keys and values?
- How can I avoid “RuntimeError: dictionary changed size during iteration” error?
- Creating a dictionary with list of lists in Python
- If in Python I put a list inside a tuple, can I safely change the contents of that list? [duplicate]
- How to extract all values from a dictionary in Python?
- Comparing 2 lists consisting of dictionaries with unique keys in python