def binary_search(li, targetValue):
low, high = 0, len[li] #error on this line
while low <= high:
mid = (high - low)/2
if li[mid] == targetValue:
return "we found it!"
elif li[mid] > targetValue:
low = mid - 1;
elif li[mid] < targetValue:
high = mid + 1;
print "search failure "
最近刚刚发布了这个问题,但我的代码仍然不起作用?