擅长:python、mysql、java
<p>您可以使用“length”属性:</p>
<pre><code>{% for n in range(yourList| length) %}
<p class="someclass">{{n + 1}}.</p>
<a class="someclass2"
href="{{ url_for( 'yourFunction', Int = yourList[n].iterable)}}">
{{yourList[n].iterable}}</a><br>
{% endfor %}
</code></pre>
<p>长度类似于python中的len(yourlist)。</p>