def findClosestValueInBST(bst , target):
    """
    You are given a BST data structure consisting of BST nodes.
    Each BST node has an integer value stored in a property
    called "value" and two children nodes stored in properties called
    "left" and "right," respectively. A node is said to be a
    BST node if and only if it satisfies the BST property:
    its value is strictly greater than the values of every
    node to its left; its value is less than or equal to the
    values of every node to its right; and both of its children
    nodes are either BST nodes themselves or None (null) values.
    You are also given a target integer value; write a function
    that finds the closest value to that target value contained in the BST.
    Assume that there will only be one closest value.
    """

    currentNode = bst
    closs_val = 0
    while(currentNode is not None):
        if((target - closs_val) >abs(target - currentNode.value)):
            closs_val = currentNode.value
        if target > currentNode.value:
            # print(currentNode.right.value)
            currentNode = currentNode.right
        elif target<currentNode.value:
            currentNode = currentNode.left
        else:
            break
    return closs_val