list of lists to a dict, where first list is the key of the dict

the list is like this

['language', 'edition']
['Pascal', 'third']
['Python', 'fourth']
['SQL', 'second']

and i would like the dict to have ‘language’ and ‘edition’ as keys where the other lists would be values, see desired output

{"language": "Pascal","edition": "third"},{"language":"Python","edition":"fourth"},{"language": "SQL","edition":"second"}

Answer

You can use a combination of dict and zip

items = [['language', 'edition'], ['Pascal', 'third'], ['Python', 'fourth'], ['SQL', 'second']]

keys = items[0]
options = items[1:]

my_dict = [dict(zip(keys, k)) for k in options]
print(my_dict)

>>> [{'language': 'Pascal', 'edition': 'third'}, {'language': 'Python', 'edition': 'fourth'}, {'language': 'SQL', 'edition': 'second'}]