Basic binary search in python
Avoid using list as the variable name, because it is a
function in Python.  
You don't need to manipulate the list, such
as list.pop() and    list.reverse(). It is inefficient. You can
determine the updated search range with index.   
When target is assigned a value not within list, there will be IndexError: list index out of range. It means you didn't handle the case well.


Modified code: 

search_list = [1,15,37,53,29,22,31,90,14,6,37,40]
target = 37
start = 0
end = len(search_list)-1 
search_list.sort()
print('The sorted list:',search_list)
while start&lt;=end:
    n = int((end + start)/2)
    if target &lt; search_list[n]: # the target is small 
        end = n-1
    elif target &gt; search_list[n]: # the target is large 
        start = n+1
    elif target == search_list[n]: # the target is found 
        print('The item {} has been found at the index {} in the sorted list.'.format(target,n))
        break 
else:
    print('The item is not found.')