How can this for-loop with range be explained : <p>Can someone please help me how to understand this code:</p>

<pre><code>j = 0
for i in range(1, 8, 2):
    j += i
    print (j)
</code></pre>

<p>The output is: 1 4 9 16</p>

<p>But I just cannot understand why. I get the concept of for-loops and range. But the involvement of the variable and the += operand makes me confused. Can someone explain this step by step, so that I can understand why the output is what it is?</p>
