Trading Implementation For Binary Search In Python