input: def dropLeafNodes(head): 
      """ Takes a Huffman tree, and drop all its leaf nodes. A leaf node is one that has no left or right children.
      >>> dropLeafNodes((1))
      None
      >>> dropLeafNodes(((2, ((4, None, None), (5, None, None))), (3, ((6, None, None), (7, None, None)))))
      ((2, None, None), (3, None, 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 head is a leaf node, return None
      if isinstance(head, tuple) and len(head) == 3 and head[1] is None and head[2] is None:
          return None
      
      # If head is a tuple, recursively process its children
      if isinstance(head, tuple):
          left = dropLeafNodes(head[1])
          right = dropLeafNodes(head[2])
          if left is None and right is None:
              return None
          return (head[0], left, right)
      
      return head