title: Comparing nested list and finding index of value match
body: <p>I'm looking to find matches within a nested list based off the 1st index, and add the floats of each of the lists that strike a match.</p>
  
  <p>Say I have this nested list:</p>
  
  <p><code>a = [[1234, 5678, 4.5], [0987, 6543, 6.8], [4321, 5678, 9.8]]</code></p>
  
  <p>I'm looking for a way to find a match for the 1st index within a list with another list within "a", and once the match is found add up the values of the 2nd index.</p>
  
  <p>I've attempted plenty of ways to check for matches, such as nested for loops, the any() function, and stuff such as: </p>
  
  <pre><code>match = []
  
  if a[x][1] in a[0:-1][1]:
     a.pop(x)
     match.append(x)
  </code></pre>
  
  <p>to create a new list based off the matches and compare them that way, but it never seems to work.
  All of these methods seem to just return if a match occurred, and not the specific index associated with the match.</p>
  
  <p>Should I create a dictionary with the keys being the 1st index and the value being the 2nd index and compare that way? Or is there some other way to check for the index of the matches and compare within a loop?</p>