3 ms·
Good point. I missed that and made a mistake. It should have been: [x * x for x in [1, 2, 3, 4] if x * x < 10] There is a subtle shift in semantics. The funct
by wenc 5y ago
Good point. I missed that and made a mistake. It should have been:
[x * x for x in [1, 2, 3, 4] if x * x < 10]
There is a subtle shift in semantics. The functional form defines a sequence of function applications whereas the list comp notation is more of a declaration.