list1 = ['k1','k2','k3']
list2 = ['v1','v2','v3']
dic = dict(map(lambda x,y:[x,y],list1,list2)) #lambda是一个匿名函数
print(dic)
print(dict(zip(list1,list2)))
print({k:v for k,v in zip(list1,list2)})
#反过来 将字典中的v和k调换
print({v:k for k,v in zip(list1,list2)})
{'k1': 'v1', 'k2': 'v2', 'k3': 'v3'}
{'k1': 'v1', 'k2': 'v2', 'k3': 'v3'}
{'k1': 'v1', 'k2': 'v2', 'k3': 'v3'}
{'v1': 'k1', 'v2': 'k2', 'v3': 'k3'}