title: Python loop with range step multiplied by two
body: <p>Simply put, I have this function in Java:</p>
  <pre><code>for( int index = 2; index &lt; size*2; index *= 2 ) // 2, 4, 8, 16, 32, 64, ...
  {
    System.out.print(index + &quot; &quot;);
  }
  </code></pre>
  <p>I want to do the same thing in a Python loop, but I am stuck on how to make the range function work like that. But I am stuck on how to make the step multiply itself by two, since</p>
  <pre><code>for index in range(2, size*2, *2):
      print(index)
  </code></pre>
  <p>I have tried all the variations I can think of:</p>
  <pre><code>for index in range(2, size*2, index = index * 2):
      print(index)
  </code></pre>
  <pre><code>for index in range(2, size*2, index * 2):
      print(index)
  </code></pre>