Question · Cours Python · Module 5: Flask et applications web

Boucle for en Jinja2

Comment démarre-t-on une boucle for dans un template Jinja2 ?

Réponses possibles

  • {{ for animal in animals }}
  • {% for animal in animals %}
  • {# for animal in animals #}
  • <% for animal in animals %>

Tu vérifieras la bonne réponse en résolvant cet exercice dans le jeu CodeWorlds.