title: Remove Duplicates from Linked List Python
body: <p>I am running below code to remove duplicates from Linked List. But my code only prints linked List before removing duplicates. Once removeDup method is called, it does not print anything. Below is my code. Please tell me what am I missing.</p>
  <pre><code>class Node:
      def __init__(self, data):
          self.data = data
          self.next = None
      
  class LinkedList:
      def __init__(self):
          self.head = None
  
      def insert(self, data):
          node = Node(data)
          node.next=self.head
          self.head = node
      
      def printl(self):
          current  = self.head
          while current:
              print current.data
              current= current.next
  
      def removeDups(self):
          current = self.head
          while current.next is not None:
              if second.data == current.data:
                  current.next = current.next.next
              else:
                  current=current.next
  
  
  l= LinkedList()
  l.insert(15)
  l.insert(14)
  l.insert(16)
  l.insert(15)
  l.insert(15)
  l.insert(14)
  l.insert(18)
  l.insert(159)
  l.insert(12)
  l.insert(10)
  l.insert(15)
  l.insert(14)
  
  l.printl()
  print &quot;===============&quot;
  
  l.removeDups()
  l.printl()
  </code></pre>