input: def dropLeafNodes(head): 
      """Drop all leaf nodes from the given Huffman tree.
      >>> node1 = Node(1)
      >>> node2 = Node(2)
      >>> node3 = Node(3)
      >>> node4 = Node(4)
      >>> node5 = Node(5)
      >>> node6 = Node(6)
      >>> node7 = Node(7)
      >>> node1.left = node2
      >>> node1.right = node3
      >>> node2.left = node4
      >>> node2.right = node5
      >>> node3.left = node6
      >>> node3.right = node7
      >>> dropLeafNodes(node1)
      Node(1, left=Node(2), right=Node(3))
      """
      # 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
  