Splitting a list into a list of block indices
<p>Suppose I have a list like this:</p>

<pre><code>myList=['A','B','C','D','E','F','G','H','I','J','K']
</code></pre>

<p>So, suppose I want to process this list as n-batches. If <code>n = 3</code>,
the I want a list called <code>batchIdx</code> <code>[(0,3),(4,7),(8,10)]</code> where each tuple points to the <code>(start,end)</code> indices of myList.</p>

<p><code>myList</code> could be of variable length. THis is not simply dividing list into equally sized chunks. Its like using <code>divmod()</code>.</p>

<p>Edit: I actually want to create a list that indexes into myList. I'll use those indices in a different part of my program.</p>

<p>What is the best way to implement this?</p>