jeudi 30 novembre 2017

jinja for loop with multiple conditionals

I'm curious as to why this does not work :



It prints both foo and bar, while when I do :



It does not print foo as expected. How can I make it so it does not print both foo and bar?

I know I can easily do this in a separate if statement inside the for loop, but I am curious as to why the above solution does not work and how to make it work in one line.

Aucun commentaire:

Enregistrer un commentaire