title: Merging tuples if they have one common element
body: <p>Consider the following list:</p>
  
  <pre><code>tuple_list = [('c', 'e'), ('c', 'd'), ('a', 'b'), ('d', 'e')]
  </code></pre>
  
  <p>How can I achieve this?</p>
  
  <pre><code>new_tuple_list = [('c', 'e', 'd'), ('a', 'b')]
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>for tuple in tuple_list:
      for tup in tuple_list:
          if tuple[0] == tup[0]:
              new_tup = (tuple[0],tuple[1],tup[1])
              new_tuple_list.append(new_tup)
  </code></pre>
  
  <p>But it only works if I have the elements of the tuple in a certain order which means it will result in this instead:</p>
  
  <pre><code>new_tuple_list = [('c', 'e', 'd'), ('a', 'b'), ('d', 'e')]
  </code></pre>