>>> x = [1, 2, 3] >>> y = [4, 5, 6] >>> z = [7, 8, 9] >>> xyz = list(zip(x, y, z)) >>> unxyz=zip(*xyz) >>> print(xyz) [(1, 4, 7), (2, 5, 8), (3, 6, 9)] >>> print(list(unxyz)) [(1, 2, 3), (4, 5, 6), (7, 8, 9)] >>>
>>> x = [1, 2, 3] >>> y = [4, 5, 6] >>> z = [7, 8, 9] >>> xyz = list(zip(x, y, z)) >>> unxyz=zip(*xyz) >>> print(xyz) [(1, 4, 7), (2, 5, 8), (3, 6, 9)] >>> print(list(unxyz)) [(1, 2, 3), (4, 5, 6), (7, 8, 9)] >>>
转载于:https://www.cnblogs.com/sea-stream/p/11246350.html