3 ms·
Understanding nested list comprehension syntax in Python
- azaras 11y agoMy rule of thumb: Better for loops when there is more than one "for" and one "if" in a list comprehension. I think it is more pythonic. Zen of python: Explicit is better than implicit. Simple is better than complex. Sparse is better than dense. Readability counts.