2

Suppose i have this

mylst = [(a, b, c), (x, y, z), (l, m, n)]

now instead of having this

{\% for item in mylst \%}    
     {{ item.0 }} {{ item.1}} {{ item.2 }}    
{\% endfor \%}

can i have another loop like

{\% for item in mylst \%}    
     {\% for a in item.length \%}
             {{item.index  }}
     {\% endfor \%}
{\% endfor \%}

1 Answer 1

3

No, and you don't want to. Iterate through the inner list in exactly the same way as the outer one.

{% for item in mylst %}
    {% for a in item %}
        {{ a }}
    {% endfor %}
{% endfor %}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.