title: Find the indices at which any element of one list occurs in another
body: <p>Take lists <code>haystack</code> and <code>needles</code></p>
  
  <pre><code>haystack = ['a', 'b', 'c', 'V', 'd', 'e', 'X', 'f', 'V', 'g', 'h']
  needles = ['V', 'W', 'X', 'Y', 'Z']
  </code></pre>
  
  <p>I need to generate a list of the indices at which any element of <code>needles</code> occurs in <code>haystack</code>. In this case those indices are 3, 6, and 8 thus </p>
  
  <pre><code>result = [3, 6, 8]
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/26569855/finding-the-indices-of-the-values-of-one-list-in-another-list">This question I found</a> is very similar and was rather elegantly solved with </p>
  
  <pre><code>result = [haystack.index(i) for i in needles]
  </code></pre>
  
  <p>Unfortunately, this solution gives <code>ValueError: 'W' is not in list</code> in my case. This is because the difference here is that an element of <code>needles</code> may occur in <code>haystack</code> a number of times or not at all. </p>
  
  <p>In other words, <code>haystack</code> may contain no needles or it may contain many. </p>