请问下zip之后把这个结果怎么打印出来?我这里用zip函数,但是打印不出来?
打印结果是:
<zip object at 0x000002D60D8A13C0>
x = [1, 2, 3]
y = [4, 5, 6]
z = [7, 8, 9]
xyz = zip(x, y, z)
u = zip(*xyz)
print(xyz)
请问下zip之后把这个结果怎么打印出来?我这里用zip函数,但是打印不出来?
打印结果是:
<zip object at 0x000002D60D8A13C0>
x = [1, 2, 3]
y = [4, 5, 6]
z = [7, 8, 9]
xyz = zip(x, y, z)
u = zip(*xyz)
print(xyz)
直接打印不行,但是循环遍历一下就可以了
x = [1, 2, 3]
y = [4, 5, 6]
z = [7, 8, 9]
xyz = zip(x, y, z)
for i in xyz:
print(i)
结果