title: How to find if a number in a list is in a interval of two numbers in a list?
body: <p>I have two sorted lists of same length, e.g.: </p>
  
  <pre><code>first_list = [3, 5, 15, 19, 23]
  second_list = [0, 11, 22, 34, 43]
  </code></pre>
  
  <p>I wish to know if the numbers of the first list are in the interval formed by the two numbers in a row from the second list. Then, i wish to print the value of the first list and the interval.</p>
  
  <p>As an example:</p>
  
  <pre><code>3 in range(0,11) # True
  5 in range(0,11) # True
  15 in range(0,11) # False, next
  15 in range(11,22) # True
  </code></pre>
  
  <p>and so on. </p>
  
  <pre class="lang-py prettyprint-override"><code>first_list = [3, 5, 15, 19, 23]
  second_list = [0, 11, 22, 34, 43]
  
  aux = 0
  count = 1
  n_iterations = len(first_list)
  iteration = 0
  while iteration != n_iterations:
      iteration += 1
      for i in first_list: 
          counter = first_list.index(i)
          try:        
              interval = range(second_list[aux],second_list[count])        
              if i in interval:
                  print(i, 'in', interval)
              if i not in interval:    
                  aux += 1
                  count += 1    
                  interval = range(second_list[aux], second_list[count])            
                  if i in interval:
                      print(i, 'in' ,interval)
          except IndexError:
              break
  </code></pre>
  
  <p>The code i've tried does actually work. But it seems so inefficient and 'hard-to-read' that there must be another way to do it.</p>