First of all, your first code doesn't use a for loop per se, but a list comprehension.
Would be equivalent to
for j in range(0, width): for i in range(0, height): m[i][j]
Much the same way, it generally nests like for loops, right to left. But list comprehension syntax is more complex.
I'm not sure what this question is asking
Any iterable object that yields iterable objects that yield exactly two objects (what a mouthful - i.e [(1,2),'ab']
would be valid )
The order in which the object yields upon iteration. i
goes to the first yield, j
the second.
Yes, but not as pretty. I believe it is functionally equivalent to:
l = list() for i,j in object: l.append(function(i,j))
or even better use map:
map(function, object)
But of course function would have to get i
, j
itself.
Isn't this the same question as 3?