zip():打包为元组的列表
a=[1,2,3]
b=[4,5,6]
zip(a,b)
[(1, 4), (2, 5), (3, 6)]
tuple():将列表转换为元组
tuple([1,2,3,4])
(1, 2, 3, 4)tuple((1,2,3,4))
(1, 2, 3, 4)tuple(zip(a,b))
((1, 4), (2, 5), (3, 6))
list():将元组转换为列表
list(tuple(zip(a,b)))
[(1, 4), (2, 5), (3, 6)]