title: Python - List of indices of elements of another list that match a condition
body: <p>It seems fairly easy but I'm kind of stuck on this one.<br>
  I have a list of logical values, e.g.:  </p>
  
  <pre><code>a=[True, False, True, True, False, False, True, True, True]
  </code></pre>
  
  <p>and I want to construct another list containing (in sub-lists) the indices of 'a' that are 'True', with successive indices put in the same sub-list. So, for the above example the answer would be:  </p>
  
  <pre><code>[[0], [2,3], [6,7,8]] 
  </code></pre>