title: Python list comprehensions to create multiple lists
body: <p>I want to create two lists <code>listOfA</code> and <code>listOfB</code> to store indices of <code>A</code> and <code>B</code> from another list s.</p>
  
  <pre><code>s=['A','B','A','A','A','B','B']
  </code></pre>
  
  <p>Output should be two lists</p>
  
  <pre><code>listOfA=[0,2,3,4]
  listOfB=[1,5,6]
  </code></pre>
  
  <p>I am able to do this with two statements.</p>
  
  <pre><code>listOfA=[idx for idx,x in enumerate(s) if x=='A']
  listOfB=[idx for idx,x in enumerate(s) if x=='B']
  </code></pre>
  
  <p>However, I want to do it in only one iteration using list comprehensions only.
  Is it possible to do it in a single statement?
  something like <code>listOfA,listOfB=[--code goes here--]</code></p>