I have a list say list[a][b] of length 10. I want to print from list[0][b] to list[10][b] and use it in jinja2 template.
{% for i in test %}
<p> {{test[i][0]}} </p>
{% endfor %}
throws error:
UndefinedError: list object has no element
You actually get the element out of the list when you iterate over it, not the index value:
{% for row in test %}
{# Note that we subscript `row` directly,
(rather than attempting to index `test` with `row`) #}
<p>{{ row[0] }}</p>
{% endfor %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With