Python 从两个List构造Dict

 

code

>>> l1=[1,2,3,4,5,6]

>>> l2=[4,5,6,7,8,9]

>>> print(dict(zip(l1,l2)))
{1: 4, 2: 5, 3: 6, 4: 7, 5: 8, 6: 9}

 

 

 

 

 

 

posted @ 2020-05-12 13:45  anobscureretreat  阅读(672)  评论(0编辑  收藏  举报