input: 
  def dropLeafNodes(head): 
      """ Takes a Huffman tree and drop all its leaf nodes.
      >>> tree = Node(1, Node(2, Node(4), Node(5)), Node(3, Node(6), Node(7)))
      >>> dropLeafNodes(tree)
      Node(1, Node(2), Node(3))
      >>> tree = Node(1, Node(2, None, Node(5)), Node(3, Node(6), None))
      >>> dropLeafNodes(tree)
      Node(1, Node(2), Node(3))
      """
      
      # 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