Binary search

A binary search is a type of search that requiers the list to be sorted it searches by halfing the list upwards or downard to find the number it is searching for it is much more eficiant than a linear search
this code is kind of easy to write aslong as you know to use a top and bottom variabel to contain the area you are searching and move half them (or double them depending wether you want a bigger or smaller number than your curent one) until the mid point is equal to the number you are searching for or the bottom varibele is bigger than the top one also you should remember to stop you midpoint being a decimal outher wise you program will crash(this is very simple you can just convert it to an int or use // instead of /)
here is some code that would work in python although keep in mind there are outher methodes

fin = False
rt =len(numbers)-1
rb = 0
print("search the list")
choice = input(">>")
choice = int(choice.strip())
 while not fin:   searchhalf= (rt + rb)//2
 if choice == numbers[searchhalf]:
  print ("you'r number (",choice,") is at",searchhalf+1)
  fin = True
 elif choice < numbers[searchhalf]:
  rt = searchhalf-1
  rb = searchhalf+1
 if rt<=rb and not fin:
  print ("that number (",choice,") is not in the list")
  fin = True