how to convert list of dict to dict

后端 未结 8 838
执笔经年
执笔经年 2020-12-12 19:00

How to convert list of dict to dict. Below is the list of dict

data = [{\'name\': \'John Doe\', \'age\': 37, \'sex\': \'M\'},
        {\'name\': \'Lisa Simp         


        
8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-12 19:19

    Let's not over complicate this:

    simple_dictionary = dict(data[0])
    

提交回复
热议问题