title: Delete in a BST
body: <p>I was wondering why my delete method for my BST is not working. I have implemented recursion and for someone reason, no nodes are being deleted.</p>
  
  <pre><code>def delete(self,node, val):
      if(node == None):
          return None
      if(val &lt; node.data):
          node.left =  self.delete(node.left,val)
      elif( val &gt; node.data):
          node.right = self.delete(node.right,val)
      else:
          if(node.right ==None and node.left ==None):
              return None
  
          elif(node.left==None): # delete the node holding 1 child
              node=node.right
  
              return node
  
          elif(node.right==None):
              node = node.left
              return node
          elif(node.right and node.left):
              delete = node.right
              while(delete.left):
                  delete = delete.left
              node.data = delete.data
              node.right = delete(node.right,delete.data)
      return node
  
  
      testTree.delete(testTree.root,30)
      testTree.printInorder(testTree.root)
  </code></pre>
  
  <p>Could it be I'm not deleting directly?</p>