title: Finding ocurrences between two list py
body: <p>I´m trying to compare 2 lists in py, then get the values repeat, put it in other list, and then get the index of the value in the very first original list, I got this</p>
  <pre><code>cecosXLS = [&quot;0101&quot;, &quot;0000&quot;, &quot;0111&quot;, &quot;0105&quot;]
  cecoManizales = [&quot;0000&quot;, &quot;0101&quot;, &quot;0111&quot;, &quot;0501&quot;, &quot;0502&quot;]
  valoresCausa = [&quot;795000&quot;,&quot;850000&quot;,&quot;140000&quot;,&quot;1450000&quot;]
  for x in range(len(cecoManizales)):
      comunesManizales = []
      temporaList = cecosXLS.copy()
      temporaList.sort()
      cecoManizales.sort()
      for item1, item2 in zip(temporaList, cecoManizales):
          if item1 == item2:
              comunesManizales.append(item1)
  for x in range(len(comunesManizales)):
          print(comunesManizales[x])
  for x in range(len(comunesManizales)):
      comun = comunesManizales[x]
      indiceComun = cecosXLS.index(comun)
      print(indiceComun)
  </code></pre>
  <p>As you can see, I sort the original list, in a new one, to compare with the list I need to, then assign the values of the occurrences in a new list, the problem here is this:</p>
  <pre><code>Very original list =  ['0101', '0000', '0111', '0105']
  Sort of the original list =  ['0000', '0101', '0105', '0111']
  List to compare with the original sort =  ['0000', '0101', '0111', '0501', '0502']
  List of occurrences in both list =  ['0000', '0101']
  </code></pre>
  <p>But the total occurrences are 3 instead of 2, '0000', '0101', '0111' but I can reach the last one, because is not in the same index in both of the sort list, how can I do this?</p>