p1 = ["name","password","hobby"]
p2 = ["jason","222","djb"]
d = {}
for i ,j in enumerate(p1):
d[j] = p2[i]
print(d)
结果:{'name': 'jason', 'password': '222', 'hobby': 'djb'}
# 字典生成式
# l = ["yang","123","read"]
# d = {i:j for i ,j in enumerate(l) if j !="123"}
# #通过 enumerate 吧每个值 富裕编号 中间判断 不等于"123" 直接剔除
# print(d)