Each Answer to this Q is separated by one/two green lines.
Is there a way in python to forloop over two or more lists simultaneously?
a = [1,2,3] b = [4,5,6] for x,y in a,b: print x,y
1 4 2 5 3 6
I know that I can do it with tuples like
l = [(1,4), (2,5), (3,6)] for x,y in l: print x,y
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .