title: Same for_loop code, print different results the second time run
body: <p>Here is my code :</p>
  
  <pre><code>for i in range (x):
      print(i)
      x=5
  </code></pre>
  
  <p>I use Spyder 3.3.2 on a Windows 10 platform. When I tried the for loop with the code I've  written above I found an interesting problem. 
  The first time I clicked the green Run file(F5) button it printed:</p>
  
  <pre><code>0
  1
  2
  3
  </code></pre>
  
  <p>But the second time I run the file it printed:</p>
  
  <pre><code>0
  1
  2
  3
  4
  </code></pre>
  
  <p>Could someone please explain what's going on? Thanks!</p>