quizzn
Discover Groups Sign up Log in
Home › Technology › Django template tags and filters

If statement

  • Answer

    {% if option1 %}
    <p>This is first option</p>
    {% elif option2 %}
    <p>not first, but second option</p>
    {% else %}
    <p>no matches </p>
    {% endif %}

This question is one of 13 in Django template tags and filters. Test yourself on all of them.

Practice quiz Flashcards

Log in to add an explanation.

Report a problem

Advertisement

More from Django template tags and filters

  • Cycle
  • Apply one or more filters
  • Loop through a dictionary
  • Loop through a list
  • Loop through a list of lists
  • What variable is not available within the for loop
  • Empty array
  • Comparison if equal
  • Include template
  • Include template
  • Include template with additional variables passed
All 13 questions →

Similar questions

  • Inline if statement: if x: y=100 else: y=20 · Python tricks

Advertisement

© 2026 Quadrupley Inc. About Blog Feedback Privacy Terms