python zip 绑定多个list

>>> a = [1, 2, 3]
>>> b = [1, 2, 3]
>>> zip(a,b)
[(1, 1), (2, 2), (3, 3)]
>>> zip(a,b,a)
[(1, 1, 1), (2, 2, 2), (3, 3, 3)]
>>> zip(a,b,a,b)
[(1, 1, 1, 1), (2, 2, 2, 2), (3, 3, 3, 3)]
>>> zip(a, [1,2])
[(1, 1), (2, 2)]

posted on 2020-03-12 11:31  庐州月光  阅读(1440)  评论(0编辑  收藏  举报