Why does the incrementor at the end of this While statement not fire
<p>I would like to nest a for statement inside of a while loop.  However, in the following example variable d does not increment by one day after the completion of the for statement.  I determined this by printing d out to my screen.</p>

<pre><code>while d &lt;= end:
    for row in reader:
        rowDate = datetime.datetime.strptime(row[0], "%m/%d/%Y")
        if row[1] == offer and rowDate == d:
            rowList.append("1")
    d += datetime.timedelta(days=1)
</code></pre>

<p>When I indent the incrementor as follows, it does execute.  But this is not the desired result as I do not want it to increment upon each iteration of the for statement.</p>

<pre><code>while d &lt;= end:
    for row in reader:
        rowDate = datetime.datetime.strptime(row[0], "%m/%d/%Y")
        if row[1] == offer and rowDate == d:
            rowList.append("1")
        d += datetime.timedelta(days=1)
</code></pre>

<p>There's probably something fundamental to Python that I'm failing to grasp.  Can someone please explain why d increments in the second example but not in the first?</p>
