title: Why did the index of the for loop change inappropriately?
body: <p>Could anyone tell me why the index of loop is 1 whereas it is initialized as 2 in the <code>for</code> loop?</p>
  <pre class="lang-py prettyprint-override"><code>for i in range(0, len(input)):
      if input[i] == 'A':
          if input[i + 1] == 'B':
              flag1 = True
              if i + 2 &lt; len(input):
                  i = i + 2
  
  </code></pre>
  <p>After the first loop, <code>i</code> changes to 1, but in the loop it is 2.</p>