I have two lists, I want to know if a date in one list is between two dates in another. How should I do this? : <p>I have a list A that looks like this:</p>

<pre><code>[((5.8, datetime.datetime(2016, 3, 5, 2, 8, 47))]
</code></pre>

<p>I have another list B that looks like this:</p>

<pre><code>[((date1, datetime.datetime(2016, 2, 8, 1, 34)),
(date2, datetime.datetime(2016, 5, 2, 1, 42)),
(date3, datetime.datetime(2016, 10, 2, 11, 23))]
</code></pre>

<p>I want to know if the date in list A is between any consecutive dates in list B.  In other words the output using the lists here would be:</p>

<pre><code>[(5.8, date2)] 
</code></pre>

<p>This is because the date in list A is between the first and second dates of list B. So I output the important value from list A (5.8) and (date2).  I would not use date1 or date3 because I want to make sure that the date from list 1 is in between two of the dates, and I use the latter date of the two dates as an output.</p>
