二分查找法
def search(num,l,start=None,end=None): start = start if start else 0 end = end if end is not None else len(l) - 1 mid = (end - start)//2 + start if start > end: return None elif l[mid] > num : return search(num,l,start,mid-1) elif l[mid] < num: return search(num,l,mid+1,end) elif l[mid] == num: return mid