Is it in the search tree?

root is a binary search tree: every value in a node's left subtree is smaller than the node's value, every value in its right subtree is larger. Write contains(root, target) that returns whether target is in the tree.

contains([8, 3, 10, 1, 6, None, 14], 6)  ->  True
contains([8, 3, 10, 1, 6, None, 14], 7)  ->  False
contains(None, 7)                        ->  False

The point is to practise using the BST rule: go left or right, never both. One check uses a tree of a hundred thousand nodes.

def contains(root, target):
    ...