title: Making a sequence of tuples unique by a specific element
body: <p>So I have a tuple of tuples</p>
  
  <pre><code>a = ((1, 2), (7, 2), (5, 2), (3, 4), (8, 4))
  </code></pre>
  
  <p>I would like to remove all the tuples from 'a' which have the a common second element, except for one (any one of them).</p>
  
  <p>For the example above I would like the new output <code>a = ((1,2),(3,4))</code></p>
  
  <p>In other words I would like to eliminate tuples which are considered duplicate elements in the second position of the tuple.</p>
  
  <p>I would like to know the most efficient way to achieve this, and also like to know if I can do the same with lists instead of tuples?</p>