 
      
      binary_search()Perform Binary search for an array.
binary_search(key, data)
key (any)  — A value to search fordata (array)  — An array to be searched. The array must be sorted in ascending order
number — Returns the index of key if found, and returns -1 if not found
import searching
 
sorted_data = [1, 2, 5, 8, 9, 10, 12, 23]
 
binary_search(23, sorted_data)    ' Returns 7
binary_search(100, sorted_data)   ' Returns -1