Courseiva
Python And PyEZhardMultiple SelectObjective-mapped

JNCIA-DevOps Python And PyEZ Practice Question

When writing Jinja2 templates for Junos configurations, which THREE control flow or filtering constructs are valid? (Choose three)

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

{% for vlan in vlans %} ... {% endfor %}

Jinja2 supports filters, loops, and conditional statements.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • [# foreach item in list #] ... [# endfor #]

    Why it's wrong here

    Incorrect. Hash-bracket syntax is used by other template engines, not Jinja2.

  • << if interface_active >> ... << endif >>

    Why it's wrong here

    Incorrect. Angle brackets are invalid for Jinja2 control tags.

  • {% for vlan in vlans %} ... {% endfor %}

    Why this is correct

    Correct. Loops use for/endfor.

  • {% if ospf_enabled %} ... {% endif %}

    Why this is correct

    Correct. Conditional statements use if/endif.

  • {{ interface_list | map(attribute='name') | list }}

    Why this is correct

    Correct. Jinja2 filters like map and list are valid.

About these practice questions

This JNCIA-DevOps question is part of Courseiva's 306-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed August 2026 · checked against the official Juniper Networks exam blueprint

This JNCIA-DevOps practice question is part of Courseiva's free Juniper Networks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the JNCIA-DevOps exam.