input: 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
  
  """ Implement a function in Python that takes a Huffman tree and drop all its leaf nodes.
  >>> dropLeafNodes((1, ((2, ((4, None), (5, None))), (3, ((6, None), (7, None)))))
  (1, ((2, None), (3, None)))
  """
output:     if isinstance(head, tuple):
          value, left, right = head[0], head[1], head[2] if len(head) > 2 else None
          if left is None and right is None:
              return None
          left = dropLeafNodes(left)
          right = dropLeafNodes(right)
          return (value, left, right)
      return head