The given code flattens the vector but I'd like to understand the execution order of the two for loops. I've checked the Python Docs too but the execution pattern is not given.
>>> # flatten a list using a list comprehension with two 'for'
>>> vec = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
>>> [num for elem in vec for num in elem]
[1,2,3,4,5,6,7,8,9]
As I understand, execution order is like abstraction (left to right)? Is there any other opinion about it.
This link is flatten using lambda expression, and my question is regarding validation of two for loop execution in List Comp: How to make a flat list out of list of lists?