1、现在有两个列表,list1 = ['key1','key2','key3']和list2 = ['4','5','6'],把他们转为字典:{ 'key1':'4','key2':'5','key3':'6'}list1 = ['key1','key2','key3']list2 = ['4','5','6']dict(zip(list1,list2)){ 'key1':'4','key2':'5','key3':'6'}2、将嵌套列表转为字典的两种方法,list1= [['key1','1'],['key2','2'],['key3','3']]dict(list){ 'key3': '3', 'key2': '2', 'key1': '1'}list= [['key1','value1'],['key2','value2'],['key3','value3']]new_dict = {} for i in list:... new_dict[i[0]] = i[1] #字典赋值,左边为key,右边为value... new_dict{ 'key3': 'value3', 'key2': 'value2', 'key1': 'value1'}