Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

The results in for loop flask did not meet the requirements

I want result are s0 s1 p2 s3 s4 s5 s6 s7 p8 s9 but result in my code are s0 s1 p2 s3 s4 s5 s6 s7 s8 s9 s0 s1 s2 s3 s4 s5 s6 s7 p8 s9 please help me

{% for x in [2,8] %}<br>
{% for i in range(10) %}
    {% if i == x|int %}
        p{{i}}
    {% else %}
        s{{i}}
    {% endif %}
{% endfor %}
{% endfor %}

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

{% for i in range(10) %}
    {% if i in [2,8]|list  %}
        p{{i}}
    {% else %}
        s{{i}}
    {% endif %}
{% endfor %}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading