Upper Bound Using Binary Search In Python Code