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
  
  assert dropLeafNodes(None) == None
  assertIsNone(dropLeafNodes(None))
  
  # Example 1:
  # Input:
  #      (1)
  #     /   \
  #   (2)   (3)
  #   / \   / \
  # (4) (5)(6) (7)
  #
  # Expected Output:
  #      (1)
  #     /   \
  #   (2)   (3)
  #   
  head = Node(1, 
              Node(2, Node(4), Node(5)), 
              Node(3, Node(6), Node(7)))
  expected_output = Node(1, Node(2), Node(3))
  assert dropLeafNodes(head) == expected_output
  
  # Example 2:
  # Input:
  #      (1)
  #       \
  #       (2)
  #        \
  #        (3)
  #
  # Expected Output:
  #      (1)
  #       \
  #       (2)
  #       
  head = Node(1, None, Node(2, None, Node(3)))
  expected_output = Node(1, None, Node(2))
  assert dropLeafNodes(head) == expected_output
  
  # Example 3:
  # Input:
  #      (1)
  #
  # Expected Output:
  #      None
  head = Node(1)
  assertIsNone(dropLeafNodes(head))
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