# -*-coding: utf-8-*-

keys = ['name', 'age', 'tel']
values = ['aqi', 3, 123456]
dict1 = dict(zip(keys, values))
print dict1

'''
{'age': 3, 'tel': 123456, 'name': 'aqi'}
'''

 

另外一种实现方式,使用lambda函数:

dict2 = dict(map(lambda x,y:[x,y], keys, values))

 

相关文章:

  • 2022-12-23
  • 2021-09-15
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
  • 2021-04-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案