Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR ASSEMBLY

jinja loop index

>>> from jinja2 import Template

>>> s = "{% for element in elements %}{{loop.index}} {% endfor %}"
>>> Template(s).render(elements=["a", "b", "c", "d"])
1 2 3 4
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jinja #loop #index
ADD COMMENT
Topic
Name
8+9 =