title: For loop with custom steps in python
body: <p>I can make simple for loops in python like:</p>
  
  <pre><code>for i in range(10):
  </code></pre>
  
  <p>However, I couldn't figure out how to make more complex ones, which are really easy in c++.</p>
  
  <p>How would you implement a for loop like this in python:</p>
  
  <pre><code>for(w = n; w &gt; 1; w = w / 2)
  </code></pre>
  
  <p>The closest one I made so far is:</p>
  
  <pre><code>for w in reversed(range(len(list)))
  </code></pre>