4 ms·
Look at the second example in https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions https://docs.python.org/3/tutorial/datastructures.html#
by andreasvc 11y ago
Look at the second example in https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions https://docs.python.org/3/tutorial/datastructures.html#list-...
Once you know how it translates to regular for loops, this syntax is pretty natural. I always put each for loop on its own line, which makes things more readable.