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>Just access the rest of the list by index:</p>

<pre><code>for i in xrange(len(L)-1):
    for j in xrange(i+1, len(L)):
        #L[i] != L[j] always, and will check just one list against the others once
</code></pre>

python python-3.x permutation