I've copied code from the book "grokking algorithms" for finding an item in the list using the binary search algorithm. The code launches great and returns no errors. However, sometimes it just doesn't work for certain numbers, for example if i call it to find "1". What's wrong?
def binary_search(list, item):
    low = 0
    high = len(list) - 1
    while low <= high:
        mid = (low + high)/2
        guess = list[mid]
        if guess == item:
            return mid
        if guess > item:
            high = mid + 1
        else:
            low = mid + 1
    return None
list1 = []
for i in range (1, 101):
    list1.append(i)
print(list1)
print(binary_search(list1, 1))

(low + high)/2should return a float in python3 which will crash your program as floats cannot be used as indices. So if you're using python2, start with upgrading to python3, as python2 is no longer supported since 2020.high = mid + 1if the guess is too high, but you also setlow = mid + 1otherwise. I'm pretty sure you meantlow = mid - 1.listas a variable name.listis already a built-in name and overriding it will most likely cause you issues in the future.