Shortening Search Algorithm.py
def Shortening_search(target):
assert 0<target<1000 #must be between 1 and 999.
list, count = range(1000), 0
while len(list) > 1:
if list[0] == target:
return count
elif list[-1] == target:
return count
else:
list.pop()
list.remove(list[0])
count += 1
return count