Binary search is not about binary numbers like 101010; it refers to repeatedly dividing a search space in half until the target is found. The same principle was historically used in artillery and tank ranging, where operators would narrow in on a target by repeatedly halving the error between overshooting and undershooting.
            

                def binary_search(arr, target):
                    left = 0
                    right = len(arr) - 1
                    while left <= right:
                        mid = (left + right) // 2
                        if arr[mid] == target:
                            return mid
                        elif arr[mid] < target:
                            left = mid + 1
                        else:
                            right = mid - 1