title: How to return list of booleans to see if elements of one list in another list
body: <p>I have two lists:</p>
  
  <pre><code>A = [1,2,3,4,5,6,7,8]
  B = [2,3,4]
  </code></pre>
  
  <p>and want to get a boolean list of length(A) where the element at each index indicates whether the element at the same index in A is in anywhere in the list B. The return value would be:</p>
  
  <pre><code>[False, True, True, True, False, False, False, False] 
  </code></pre>
  
  <p>It would be easy to write a function, but want to know if there is a paradigmatic way of doing it in Python.</p>
  
  <p>In R, the counterpart would be </p>
  
  <pre><code>which(A %in% b)
  </code></pre>