def bin_find(data, n): low = 0 high = len(data) - 1 while low <= high: mid = (low + high) // 2 if data[mid] == n: return mid elif data[mid] < n: low = mid + 1 elif data[mid] > n: high = mid - 1 return