title: How to compare two lists of strings and return the matches
body: <p>I have this question as homework and I can't figure it out.</p>
  <p>You have 2 lists of strings with contents of your choice.
  Use a loop that goes through the lists and compares the lists elements and displays only the list elements that duplicate (the element exists in both lists). The strings should be displayed even if in one is used uppercase and in the other lowercase or a combination of it.</p>
  <p>I don't know why it's not working.</p>
  <pre><code>animals = [&quot;dog&quot;, &quot;bear&quot;, &quot;monkey&quot;, &quot;bird&quot;]
  pets = [&quot;dog&quot;, &quot;bird&quot;, &quot;cat&quot;, &quot;snake&quot;]
  
  print(&quot;The original list 1 : &quot; + str(animals))
  print(&quot;The original list 2 : &quot; + str(pets))
  
  res = [animals.index(i) for i in pets]
  
  print(&quot;The Match indices list is : &quot; + str(res))
  </code></pre>