python zip

 a=['a','b','c']
 b=[1,2,3]
 for i in c:
    print(i)



('a', 1)
('b', 2)
('c', 3)
 d=dict(zip(a,b))

d
Out[10]: {'a': 1, 'b': 2, 'c': 3}
posted @ 2022-08-19 22:59  luoganttcc  阅读(9)  评论(0编辑  收藏  举报