input: def dropLeafNodes(head): 
      """ Drop all leaf nodes from the given Huffman tree.
      >>> dropLeafNodes(Node(Node(Leaf(4), Leaf(5)), Node(Leaf(6), Leaf(7))))
      Node(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.left is None and head.right is None:
          return None
      return head