Program - function to convert a list of tuples into dictionary


Topic: Program - function to convert a list of tuples into dictionary

Solution

def list_to_dict(l: list):
    final_dict = {}
    for i in l:
        final_dict[i[0]] = i[1]
    return final_dict



List all Python Programs