title: Finding Duplicate element in list of tuples
body: <p>In the List of tuples, add the 2nd element if the first and last element matches with the other tuples.</p>
  
  <pre><code>    p =[(u'basic', 7698, '01-2017'),
      (u'basic', 7685, '01-2017'),
      (u'Gross', 4875.0, u'01-2017'),
      (u'Gross', 4875.0, u'01-2017')]
  </code></pre>
  
  <p>And the output should be like </p>
  
  <pre><code>    [(u'basic',15383,'01-2017'),(u'Gross', 9750.0, u'01-2017')]
  </code></pre>
  
  <p>I'm trying to do this way</p>
  
  <pre><code>   o=[]        
     for i in p:
       if i[2] not in o:
          o.append(i[2])
       if i[0] not in o:
          o.append(i[0])
     count +=i[1]
     o.append(count)
  </code></pre>
  
  <p>my o/p:</p>
  
  <pre><code>   ['01-2017', 'basic', u'Gross', 53050.0, 4875.0]
  </code></pre>