n is present in the generated Python code only
once, so there’s no issue with placing a block inside of a loop or
similar. Anonymous blocks are defined as closures in the local
rendering body, so have access to local variable scope:</p>
<div class="highlight-mako notranslate"><div class="highlight"><pre><span></span><span class="cp">%</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span cla