For loop to compare one element with all the remaining elements of an array
<p>I have an array in Python <code>[0,1,2,3,4]</code> with 5 elements. I want to compare elements in following fashion.</p>

<pre><code>(0,1),(0,2),(0,3),(0,4),(1,2),(1,3),(1,4),(2,3),(2,4),(3,4),(4,4)
</code></pre>

<p>What I am doing is as follows.</p>

<pre><code>for i in range(len(array)):
   for j in range(i+1,len(array)):
</code></pre>

<p>But this is comparing in following fashion.</p>

<pre><code>(0,1),(1,2),(2,3),(3,4)... 
</code></pre>

<p>Where I am doing it wrong?</p>