When we use python2 to run the following code, The result is
[(1, 2), (2, 3), (3, 4)]
m: 1, n: 2
m: 2, n: 3
m: 3, n: 4
Otherwise, using python3
[(1, 2), (2, 3), (3, 4)]
I think the result of python3 doesn't make sense? anybody can tell me why?
a = [1, 2, 3]
b = [2, 3, 4]
c = zip(a,b)
print(list(c))
for (m,n) in list(c):
print('m: {}, n: {}'.format(m, n))
zipreturns but since convert tolistanyway this doesn't matter.