input: 
  def dropLeafNodes(head): 
      """
      Given a Huffman tree, drop all its leaf nodes.
      >>> head = BinaryTreeNode(1)
      >>> head.left = BinaryTreeNode(2)
      >>> head.right = BinaryTreeNode(3)
      >>> head.left.left = BinaryTreeNode(4)
      >>> head.left.right = BinaryTreeNode(5)
      >>> head.right.left = BinaryTreeNode(6)
      >>> head.right.right = BinaryTreeNode(7)
      >>> dropLeafNodes(head)
      <__main__.BinaryTreeNode object at 0x...>
      """
      # If node is not None and doesn't have any children 
      if head and not head.left and not head.right: 
          return None
    
      # Don't change anything if head is None 
      if not head: 
          return None
    
      # Recursively call dropLeafNodes on left and right subtrees
      head.left = dropLeafNodes(head.left) 
      head.right = dropLeafNodes(head.right) 
    
      # Return head of the modified tree
      return head
  
output:     
      # If node is not None and doesn't have any children 
      if head and not head.left and not head.right: 
          return None
    
      # Don't change anything if head is None 
      if not head: 
          return None
    
      # Recursively call dropLeafNodes on left and right subtrees
      head.left = dropLeafNodes(head.left) 
      head.right = dropLeafNodes(head.right) 
    
      # Return head of the modified tree
      return head
  