input: def dropLeafNodes(head): 
      """
      This function takes a Huffman tree (encoded as a binary tree) and drops all its leaf nodes.
      A leaf node is a node with no left or right children.
      >>> class Node:
      ...     def __init__(self, value, left=None, right=None):
      ...         self.value = value
      ...         self.left = left
      ...         self.right = right
      >>> n4 = Node(4)
      >>> n5 = Node(5)
      >>> n6 = Node(6)
      >>> n7 = Node(7)
      >>> n2 = Node(2, n4, n5)
      >>> n3 = Node(3, n6, n7)
      >>> head = Node(1, n2, n3)
      >>> modified_head = dropLeafNodes(head)
      >>> modified_head.value
      1
      >>> modified_head.left.value
      2
      >>> modified_head.right.value
      3
      >>> modified_head.left.left is None
      True
      >>> modified_head.left.right is None
      True
      >>> modified_head.right.left is None
      True
      >>> modified_head.right.right is None
      True
      """
      # 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
  