📜  jinja 循环索引 - 汇编代码示例

📅  最后修改于: 2022-03-11 14:48:10.177000             🧑  作者: Mango

代码示例3
>>> from jinja2 import Template

>>> s = "{% for element in elements %}{{loop.index}} {% endfor %}"
>>> Template(s).render(elements=["a", "b", "c", "d"])
1 2 3 4