title: Comparing two list and returning the indices of the matched items with python
body: <p>I have two lists</p>
  
  <pre><code>a = [1.1, 2.2, 5.6, 7.8,7.8, 8.6,10.2]
  b = [2.2, 1.4, 1.99, 7.88, 7.8]
  </code></pre>
  
  <p>I want both lists to be compared and the indices of entities which delivered the same value with reference to the list a. There can be multiple hits in list a.</p>
  
  <p>The results is</p>
  
  <pre><code>c= [1,3,4]  # with reference to a as 2.2 occur at location 1, 7.8 at location 3 and 4. 
  </code></pre>
  
  <p>I found a similar question but for case the multiple hits were not captured! and the first accepted answer does not print the indices! There is no print in the loop.</p>
  
  <p><a href="https://stackoverflow.com/questions/10367020/compare-two-lists-in-python-and-return-indices-of-matched-values">compare two lists in python and return indices of matched values</a></p>
  
  <p>regards,</p>