def binary_search(data,y,low=0,high=None): high = high if high is not None else len(data) while(low <= high): mid = (low+high)//2 if y==data[mid]: result = y return result elif y>data[mid]: low=mid+1 else : high=mid-1 return -1
if __name__ ==‘__main__‘: data=[] x=88 for i in range(0,100): data.append(i) index = binary_search(data,x) print (index)