Double for loop in Python3
<p>There is list named L.
Which contains others list: L=[A,B,C,...N]
I want to for-loop, where B is no equal A (see #2)
Something like: for B is not A in L:</p>

<pre><code>for A in L: #1
    for B in L: #2
</code></pre>

<p>How can I do that?</p>

<p>You can use an <code>if</code> statement to filter out the cases you don't want:</p>

<pre><code>for A in L:
    for B in L:
        if A == B:
            continue # skip
        # do stuff ...
</code></pre>

python python-3.x permutation