def rangeBinarySearch( sequence, a, b ):
  """ 
  Function to search a value between a given interval in sequence using binary search algorithm. 
  
  Parameters:
      sequence(list); the sequence of different values 
      a(int); the lower limit of the interval
      b(int); the upper limit of the interval
      
  Returns:
      A boolean value; True if a value is found between the given interval, otherwise false.

  Raises:
      TypeError: If user provides inputs of an unsupported type.
  
  """

  try:

    typeSeq = isinstance(sequence,list)
    typeA = isinstance(a,int) or isinstance(a,float)
    typeB = isinstance(b,int) or isinstance(b,float)

    if not(typeSeq) or not(typeA) or not(typeB): #If wrong types of input are provided
      raise TypeError

    if b < a: #When the user provides upper limit value lesser than lower limit value
      (a,b) = (b,a)
      print("The upper limit value is lesser than lower limit value.")
      print("Inorder to proceed, This function has swapped the values of upper and lower limits")
      
      

    #Binary Search Algorithm
      
    start = 0
    end = len(sequence)-1
    
    while start <= end:
      
      mid = (start+end)//2 #pivot
      
      if a <= sequence[mid] <= b : #if the middle value of sequence is in the range
        
        return True
      
      elif b < sequence[mid]: #if upper limit is lesser than middle value
        
        end = mid -1 
        
      else: # if upper limit is greater than middle value
        
        start = mid +1 
  
    return False 

  except TypeError: #If user provides unsupported types of input
    
    print("Error: Please provide the sequence of type 'list'")
    print("       and limits of type 'int' and try again.")
    return False