input: def dropLeafNodes(head):
      """Implement a function that takes a Huffman tree (represented by a binary tree) and drop all its leaf nodes.
      If the node is a leaf, it should be removed from the tree.
  
      Example:
      For the tree:
           (1)
          /   \
        (2)   (3)
        / \   / \
      (4) (5) (6) (7)
  
      The function should return:
           (1)
          /   \
        (2)   (3)
  
      >>> from collections import namedtuple
      >>> Node = namedtuple('Node', ['left', 'right'])
      >>> tree = Node(left=Node(left=4, right=5), right=Node(left=6, right=7))
      >>> dropLeafNodes(tree)
      Node(left=Node(left=None, right=None), right=Node(left=None, right=None))
      """
  
      # 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