def list2dict ( lst ) : dic = { } for k , v in lst : dic [ k ] = v return dic
how to turn a list into a dictionary python
Takes a list of ( key value ) pairs and turns it into a dict .
def list2dict(lst):
    """Takes a list of (key,value) pairs and turns it into a dict."""

    dic = {}
    for k,v in lst: dic[k] = v
    return dic