title: Python: Compare elements in a list to each other
body: <p>I'm currently looking for a way to compare elements of a list to one another going from left to right.</p>
  
  <p>Here is my list:</p>
  
  <pre><code>mylist = [[15], [14, 15], [19, 20], [13], [3], [65, 19], [19, 20, 31]]
  </code></pre>
  
  <p>I need to compare the first element to all others and check if any of the values match, same thing for the second and third element and so on until it reaches the end of the list. If there is a match, I need to print it out. I need to print out the value that has match and the index that it matched at.</p>
  
  <p>For example.</p>
  
  <pre><code>index 0 matched with index 1 for value 15.
  index 2 matched with index 5 for value 19
  index 2 matched with index 6 for value 19
  index 2 matched with index 6 for value 20
  index 5 matched with index 6 for value 19.
  </code></pre>
  
  <p>How can I go about doing this?</p>