accessing two list elements to get results
<p>I have two lists. One list name 'date' has dates in it which are related to persons birth date.</p>

<pre><code>data = [ datetime.datetime(1958, 3, 15, 0, 0), datetime.datetime(1958, 9, 15, 0, 0), datetime.datetime(1930, 10, 23, 0, 0), datetime.datetime(1928, 9, 15, 0, 0), datetime.datetime(1928, 1, 23, 0, 0), datetime.datetime(1925, 11, 15, 0, 0), datetime.datetime(1962, 7, 20, 0, 0),datetime.datetime(1960, 12, 14, 0, 0), datetime.datetime(1960, 5, 10, 0, 0),datetime.datetime(1963, 9, 7, 0, 0), datetime.datetime(1956, 3, 10, 0, 0), datetime.datetime(1955, 2, 15, 0, 0),datetime.datetime(1958, 11, 14, 0, 0),datetime.datetime(1956, 8, 24, 0, 0),datetime.datetime(1990, 4, 30, 0, 0)] 
</code></pre>

<p>Now next list contains marriage dates. </p>

<pre><code>marriage = [ datetime.datetime(1985, 5, 14, 0, 0),datetime.datetime(1945, 6, 15, 0, 0), datetime.datetime(1938, 6, 11, 0, 0), datetime.datetime(1995, 4, 5, 0, 0), datetime.datetime(1987, 2, 26, 0, 0), datetime.datetime(1983, 12, 13, 0, 0), datetime.datetime(1980, 9, 16, 0, 0),  datetime.datetime(2011, 6, 19, 0, 0)]
</code></pre>

<p>each date from the 'marriage' list is related to 2 dates from 'date' list. Now, I want to compare one date from marriage list to two dates from date list so that i can print"birth date is less than marriage.</p>

<p>How can accomplish this task using loop? confused with this one. </p>

<p>Please note that I used  import datetime, import re to accomplish date comparison.</p>