I know one way to determine if an object is in an array:
if object in array:
print "object is in array"
However this can be slow if the array is large. I assume the algorithm works by looking at every object in the array and compares it to the object being searched for. If know the array is sorted (low to high) the algorithm can stop looking once an object in the array is larger than the object being searched for (and conclude the object is not in the array). How would this be efficiently implemented in Python?