title: Finding common elements in list in python
body: <p>Finding common elements in list in python?
  Imagine if i have a list like follows
  [[a,b],[a,c],[b,c],[c,d],[e,f],[f,g]]
  My output must be
  [a,b,c,d]
  [e,f,g]
  How do i do it?
  What i tried is like this</p>
  
  <pre><code>for i in range(0,len(fin3)):
      for j in range(i+1,len(fin3)):
          grop = []
          grop = list(set(fin3[i]) &amp; set(fin3[j]))
          if len(grop)&gt;0:
              grop2 = []
              grop2.append(link[i])
              grop2.append(link[j])
              grop3.append(grop2)
  </code></pre>
  
  <p>Thanks in advance...</p>