def binSearch(arr, val):
 i = bisect_left(arr, val)
 if ((i != len(arr)) and (arr[i] == val)):
  return i
 return (-1)

def binSearch ( arr , val ) : i = bisect_left ( arr , val ) if ( ( i != len ( arr ) ) and ( arr [ i ] == val ) ) : return i return ( - 1 )
function for running binary search on a sorted list .