HEAD
list1 = [1, 2, 3, 4, 5, 6] ======= 星星之火,可以燎原
list1 = [1, 2, 3, 4, 5, 6] >>>>>>> 4ef99384a791603d1ae54a12162221aa23eb330e def binary_search(list_v, item): low = 0 high = len(list_v) - 1 while low <= high: mid = int((low + high) / 2) guess = list_v[mid] if guess == item: return mid if guess > item: high = mid - 1 else: low = mid + 1 return None print(binary_search(list1,3))