算法图解1.2二分查找报TypeError: list indices must be integers or slices, not float解决方法
defbinary_search(list,item):low=0high=len(list)-1whilelowitem:high=mid-1else:low=mid+1returnNonemy_list=[1,3,5,7,9]print(binary_search(my_list,3))print(binary_search(my_list,-1))将以下这一行mid=(low+high)/2