In python how would you iterate through a list (column names) and a list of tuples (row values) in order to build a list of dictionaries? The keys always being generated from the first array and the values generated from each tuple?
col = ['id', 'username', 'email']
rows = [('1234', 'first', '[email protected]'), ('5678', 'second', '[email protected]')]
result = [{'id':'1234', 'username':'first', 'email':'[email protected]'},{'id':'5678', 'username':'second', 'email':'[email protected]'}]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…