title: How to merge first part of a list value prior to a character, based on the values after the character in python
body: <p>I have a scenario where I need to combine the element values of a list in python. This is based on the values coming after a specific character in the element. For example:
  I have a below input list value</p>
  
  <pre><code>[('245|CALENDAR_DATE-DATE'), ('129|AREA-VARCHAR'),('450|DIVISION-VARCHAR'),('678|CALENDAR_DATE-DATE'),('298|DIVISION-VARCHAR')]
  </code></pre>
  
  <p>I have to get the output list as below </p>
  
  <pre><code>[('245,678|CALENDAR_DATE-DATE'), ('129|AREA-VARCHAR'),('450,298|DIVISION-VARCHAR')]
  </code></pre>
  
  <p>So in the list, if the values of two elements after the pipe(|) is same, I have to club the values before pipe(|) as comma separated values. </p>
  
  <p>The clubbing should occur into the element which is placed first out of the two.</p>
  
  <p>Thanks in advance.</p>