Below, set1, set2, set3 are lists with len(setn) =len(index). I want to loop over each of these lists (setn) as follows,
index = range(10)
set1 = range(10,20)
set2 = range(30,40)
set3 = range(40,50)
listset = [set1, set2, set3]
for i in listset:
for k, j in zip(index, i):
print k, j
Result:
0 s
1 e
2 t
3 1
0 s
1 e
2 t
3 2
0 s
1 e
2 t
3 3
How can I get a result that prints the each element of "index, set1" (as given below),followed by "index, set2", followed by "index, set3".
0 10
1 11
2 12
3 13
4 14
5 15
6 16
7 17
8 18
9 19
and so on...
'set1'etc with the real variable namesset1(note no more apostrophes, produces the wished output ;-)