x = ["Mon", "Tues", "Wed", "Thur", "Fri","Sat","Sun"]
y = [20, 40, 35, 55, 42, 80, 50]
z=[1,2,3,4,5,6,7]
for x1, y1,z1 in zip(x,y,z):
print(x1,y1,z1)
for x in zip(x,y,z):
print(x)
输出的结果是正确的
Mon 20 1
Tues 40 2
Wed 35 3
Thur 55 4
Fri 42 5
Sat 80 6
Sun 50 7
('Mon', 20, 1)
('Tues', 40, 2)
('Wed', 35, 3)
('Thur', 55, 4)
('Fri', 42, 5)
('Sat', 80, 6)
('Sun', 50, 7)
然而
x = ["Mon", "Tues", "Wed", "Thur", "Fri","Sat","Sun"]
y = [20, 40, 35, 55, 42, 80, 50]
z=[1,2,3,4,5,6,7]
for x in zip(x,y,z):
print(x)
for x1, y1,z1 in zip(x,y,z):
print(x1,y1,z1)
输出的却是
('Mon', 20, 1)
('Tues', 40, 2)
('Wed', 35, 3)
('Thur', 55, 4)
('Fri', 42, 5)
('Sat', 80, 6)
('Sun', 50, 7)
Sun 20 1
50 40 2
7 35 3
这是为啥?