二分查找
def bin_search(data, value):
low = 0
hight = len(data) - 1
while low <= hight:
mid = (low+hight) // 2
if data[mid] == value:
return mid
elif data[mid] > value:
hight = mid - 1
else:
low = mid + 1
print(bin_search([2,1,8,3,6,9],6))