📜  zip python 代码示例

📅  最后修改于: 2022-03-11 14:45:29.504000             🧑  作者: Mango

代码示例5
>>> x = [1, 2, 3]
>>> y = [4, 5, 6]
>>> zipped = zip(x, y)
>>> list(zipped)
[(1, 4), (2, 5), (3, 6)]
>>> x2, y2 = zip(*zip(x, y))
>>> x == list(x2) and y == list(y2)
True