title: fast way to compare whether the number is in the list of ranges in python
body: <p>I need to compare a list of number to a list of range and see is the number is inside any of range.</p>
  
  <p>Example:</p>
  
  <pre><code>list1 = [23,100,1,50,60,73]
  list2 = [[0-10],[25-35],[100-110],[75-85]]
  </code></pre>
  
  <p>So i need to iterate list1 and compare this number with the list of range and see if this number fall in any of the range, if yes, i will increase the counter for that range.</p>
  
  <p>both lists will be very big (100k to few millions or more) and the number is random.</p>
  
  <p>So what is the best way to handle this problem?</p>
  
  <p>Edit - the format of list could be list like [low,high,counter]. The example above is data sample and it is not really follow Python code syntax. both list will be huge. </p>
  
  <p>Also the number is int.</p>
  
  <p>Thanks.</p>