python中将两个list合并为字典 两个list合并为字典的代码如下: defRun(): list2= [1, 2, 3, 4, 5]; list3= ["a","b","c","d","e"]; dict={}; i=0; length=len(list2);whilei<length:'dict[list2[i]]=list3[i];这种方法也可以'dit={list2[i]:list3[i]}; dict.update(dit);...
python中将两个list合并为字典两个list合并为字典的代码如下:def Run():list2 = [1, 2, 3, 4, 5 ];list3 = ["a", "b", "c", "d","e"];dict={};i=0;length=len(list2);while i<length:'dict[list2[i]]=list3[i];这种⽅法也可以'dit={list2[i]:list3[i]};dict.update(dit...