input: 
  def dropLeafNodes(head):
      """
      Take a Huffman tree and drop all its leaf nodes.
      >>> dropLeafNodes({
              'value': 1,
              'left': {
                  'value': 2,
                  'left': {
                      'value': 4,
                      'left': None,
                      'right': None
                  },
                  'right': {
                      'value': 5,
                      'left': None,
                      'right': None
                  }
              },
              'right': {
                  'value': 3,
                  'left': {
                      'value': 6,
                      'left': None,
                      'right': None
                  },
                  'right': {
                      'value': 7,
                      'left': None,
                      'right': None
                  }
              }
          })
      {'value': 1, 'left': {'value': 2, 'left': None, 'right': None}, 'right': {'value': 3, 'left': None, 'right': None}}
      """
      if head and not head.left and not head.right: 
          return None
      if not head: 
          return None
      head.left = dropLeafNodes(head.left) 
      head.right = dropLeafNodes(head.right) 
      return head
  
output:     if head and not head.left and not head.right: 
          return None
      if not head: 
          return None
      head.left = dropLeafNodes(head.left) 
      head.right = dropLeafNodes(head.right) 
      return head