title: python for increment inner loop
body: <p>How to increment the outer iterator from the inner loop? </p>
  
  <p>To be more precise:</p>
  
  <pre><code>  for i in range(0,6):
      print i
      for j in range(0,5):
        i = i+2
  </code></pre>
  
  <p>I am getting</p>
  
  <pre><code>0
  1
  2
  3
  4
  5
  </code></pre>
  
  <p>, but I want <code>0,2,4</code></p>
  
  <p>Above is the simpilfied idea what I want to acheive.</p>
  
  <p>Here is my Java code:</p>
  
  <pre><code>str1="ababa"
  str2="aba"
  for(int i =0; i &lt; str1.length; i++)
    for(int j =0; j &lt; str2.length; j++)
         if str1[i+j]!=str[j]
             break;
         if( j ==str2.length -1)
             i=i+str2.length;
  </code></pre>