I have the following list:
l = [('Alice',12),('Bob',10),('Celine',11)]
I want to get the following dict
(as correctly pointed in a comment below, this is not a dict. In reality, I just want a list of dicts):
[
{'name':'Alice','age':12},
{'name':'Bob','age':10},
{'name':'Celine','age':11}
]
Is there a way I can use dict comprehension
to achieve this?