double for loops counter in python
<p>I want to count the number of loops in this basic example:</p>

<pre><code>numSt = []
numSti = 0
for i in xrange(0,2):
    for j in xrange(0,2):
        numSti += 1
        numSt.append(numSti)
</code></pre>

<p>I get numSti:
(1,2,1,2) instead of (1,2,3,4)....</p>

<p>My real code is also very basic, the difference is that "2" is replaced by a integer variable.</p>

<p>My mistake. The code is OK! I then had:</p>

<pre><code>for i in xrange(0,numStY_total): #ordered in rows
    for j in xrange(0,numStX_total):
        numSti += 1
        numSt.append(numSti)
        coordSt.append((i+1,j+1,numSt[j],x[j],y[i],z[0]))
</code></pre>

<p>which is why I got 1,2 and 1,2. Instead it should be something like:</p>

<pre><code>        coordSt.append((i+1,j+1,numSt[counter],x[j],y[i],z[0]))
</code></pre>
