input: Write a function in Python that takes a Huffman tree and drop all its leaf nodes.
  def dropLeafNodes(head):
      
      # 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
  
  # Example assertions:
  assert dropLeafNodes(HuffmanNode(1, HuffmanNode(2, HuffmanNode(4, None, None), HuffmanNode(5, None, None)), HuffmanNode(3, HuffmanNode(6, None, None), HuffmanNode(7, None, None)))).toString() == HuffmanNode(1, HuffmanNode(2, None, None), HuffmanNode(3, None, None)).toString()
  assert dropLeafNodes(HuffmanNode(1, None, None)) == None
  assert dropLeafNodes(HuffmanNode(1, HuffmanNode(2, None, None), None)) == HuffmanNode(1, None, None)
  assert dropLeafNodes(None) == None
output: def dropLeafNodes(head):
      
      # 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