hello I want to set the value of an item in a list in jinja2, for that I'm trying
<code>
{% set arr=[0,0,0,0,0,0,0,0] %}
{% print arr %}
{% set arr[1] = 1 %}
{% print arr %}
</code>
but receive an error message saying:
TemplateSyntaxError: expected token '=', got '['
please any advice, thanks in advance
set
) but you cannot mutate an old value so only part of it is new. And you should not want to. (You can do this by importing thedo
block extension to jinja, but again you really should not do it that way). – Martlet