title: Python: How to have nested for-loops indexes that don't start from 0?
body: <p>So one issue I discovered with python is that it is not very user-friendly to create nested loops each with their own indexes. </p>
  
  <p>How would I write the Python-equivalent of this Java code:</p>
  
  <pre><code>for(int i = 0; i &lt; array.length-2; i++){
      for(int j = i+1; j &lt; array.length-1; j++){ 
         for(int k = j+1; k &lt; array.length; k++){
  </code></pre>
  
  <p>Notice how I reference the counter value of the predecessor's for each nested loop. I tried using:</p>
  
  <p><code>for idx, val in enumerate(nums[:-2]):</code></p>
  
  <p>but it seems like <code>idx</code> will always start at 0 rather than start at the predecessor's index value. Is there a better solution besides maintaining separate counter variables?</p>