"global name 'forloop' is not defined "in django view :ERROR
<pre><code>for hotel in hotels:
     if xyz:
       if forloop.counter &lt;= 3:
        similar_venues.append(hotel)
        break;
</code></pre>

<p>its giving me the below error:
global name 'forloop' is not defined</p>
