title: While loop modify global variable
body: <p>I thought loops in python do not change our global variables; however, the code below gives 10 as a result. Can someone explain what is happening here?</p>
  
  <pre><code>source_col_numbers = 9
  i = 1
  columns = {}
  
  while i &lt;= source_col_numbers:
      columns[i] = list(filter(None , source.sheet1.col_values(i)))
      i += 1
  
  print(i)
  </code></pre>