input: def dropLeafNodes(head): 
      """
      Takes a Huffman tree and drops all its leaf nodes.
      
      >>> dropLeafNodes(None)
      None
      >>> dropLeafNodes((1, (2, (4, None, None), (5, None, None)), (3, (6, None, None), (7, None, None))))
      (1, (2, None, None), (3, None, None))
      """
      
      # If node is not None and doesn't have any children 
      if head and not head[1] and not head[2]: 
          return None
    
      # Don't change anything if head is None 
      if not head: 
          return None
    
      # Recursively call dropLeafNodes on left and right subtrees
      head = (head[0], dropLeafNodes(head[1]), dropLeafNodes(head[2]))
    
      # Return head of the modified tree
      return head
output:     # If the left child is a leaf, drop it
      if head[1] and not head[1][1] and not head[1][2]:
          head = (head[0], None, head[2])
      
      # If the right child is a leaf, drop it
      if head[2] and not head[2][1] and not head[2][2]:
          head = (head[0], head[1], None)
      
      return head