How to convert my tuple to dict? [closed]

If you want to convert a list of tuples of the form (key, value) into a dictionary, you could use dictionary comprehension:

{x:y for (x, y) in tuples}

Leave a Comment