Convert a list of tuples into a list of dict(将元组列表转换为 dict 列表)
问题描述
我有一个元组列表:
我想把它转换成字典列表:
I want to convert it into a list of dictionary:
最好和最有效的方法是什么?
What's the best and efficient way to do it?
推荐答案
你可以使用 zip
函数.
You can make use of zip
function.
演示
这篇关于将元组列表转换为 dict 列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!