title: How to find the indices of items in a list, which are present in another list?
body: <p>I want to essentially use one list ie.</p>
  <pre><code>L = [10, 10, 100, 10, 17, 15]
  </code></pre>
  <p>and using another list</p>
  <pre><code>R = [10, 15] 
  </code></pre>
  <p>want to return</p>
  <pre><code>N = [0, 1, 3, 5] // indices of L that return the values in R
  </code></pre>
  <p>I tried using <code>L.index()</code> to get the indices but that only returns the first value. I then tried running a for loop over <code>L</code> and using <code>L.index(R[0])</code> every time, but similarly that only returns the first indices it finds at.</p>
  <pre><code> for i in range(len(L)):
         j = R[i]
         N.append(L.index(j))
   return N
  </code></pre>
  <p>This would return index out of range which makes sense, but how do I get it to run through the <code>L</code>?</p>