Iterating within a function using for loop doesn't work?
<p>When I use for loop within a function (see below), the block of statements below the for loop is not iterated, </p>

<pre><code>def F(rho, m, E, v_rho, v_m, v_E):
    for n in xrange(N):
        #Update conserved quantities
        rho = G(Evolve_rho1(rho))
        m = momentum(Evolve_m1(m))
        E = Energy(Evolve_E1(E))
        v_rho = rho_v(Evolve_rho_v(rho))
        v_m = m_v(Evolve_mv(m))
        v_E = E_v(Evolve_Ev(E))

    return (rho, m, E, v_rho, v_m, v_E)
</code></pre>

<p>since after calling the function in this way: <code>density, momentum, Energy, dflux, mflux, Eflux = F(rho, m, E, v_rho, v_m, v_E)</code>, and 
print for example density, leads to wrong answer.</p>

<p>But if I only use for loop like below, it works fine.</p>

<pre><code>for n in xrange(N):
    #Update conserved quantities
    rho = G(Evolve_rho1(rho))
    m = momentum(Evolve_m1(m))
    E = Energy(Evolve_E1(E))
    v_rho = rho_v(Evolve_rho_v(rho))
    v_m = m_v(Evolve_mv(m))
    v_E = E_v(Evolve_Ev(E))
print rho
print m
</code></pre>

<p>etc., give correct results.</p>

<p>Any suggestion is welcome and appreciated.</p>
