Courseiva
mediumMultiple Select

CCNP Practice Question: Which two statements about using Python for…

Which two statements about using Python for configuration management and templating in network automation are true? (Choose two.)

⚠ Common exam trap

350-401 often tests the misconception that Jinja2 can execute device commands or parse YAML, when it is strictly a text templating engine that must be paired with separate libraries for I/O and parsing.

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

✓

Jinja2 templates allow the use of variables and control structures like loops and conditionals to generate network device configurations.

Option A is correct because Jinja2 is a templating engine that supports variables, loops ({% for %}), and conditionals ({% if %}), which are used to dynamically generate network device configurations. Option B is correct because a typical Python automation workflow loads a Jinja2 template, renders it with device-specific data (e.g., from YAML/JSON), and then pushes the rendered configuration to the device via libraries like Netmiko or NAPALM. Option C is incorrect because Jinja2 only renders text; it cannot execute CLI commands on devices—that requires a separate connection library. Option D is incorrect because Jinja2 is a templating engine, not a YAML parser; YAML parsing is handled by libraries like PyYAML. Option E is incorrect because Python, combined with Jinja2, is widely used to generate configuration files.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Jinja2 templates allow the use of variables and control structures like loops and conditionals to generate network device configurations.

    Why this is correct

    Jinja2 is a text templating engine, so variables, for loops, and if conditionals let one template generate many device-specific configurations. This satisfies the scenario's templating requirement, unlike plain string concatenation, which cannot express conditional or repeated configuration blocks.

  • ✓

    A Python script can load a Jinja2 template, render it with device-specific data, and push the resulting configuration to a network device.

    Why this is correct

    Jinja2's render step produces configuration text from a template plus device variables, which a library such as Netmiko or NAPALM then pushes over SSH or NETCONF. This satisfies the end-to-end configuration management requirement, combining templating with programmatic delivery.

  • ✗

    Jinja2 can be used to execute CLI commands on network devices directly from within the template.

    Why it's wrong here

    Jinja2 renders text templates; it has no transport mechanism to reach devices, so it cannot execute CLI commands itself. It is tempting because templates often generate CLI command strings, but execution requires a separate library such as Netmiko or NAPALM driving the connection.

  • ✗

    Jinja2 is a Python library used for parsing YAML files.

    Why it's wrong here

    Jinja2 is a templating engine that renders text; YAML parsing is handled by PyYAML or ruamel.yaml. It is tempting because Jinja2 templates frequently consume YAML variable files, but the library itself performs no parsing of that data.

  • ✗

    Python cannot be used to generate configuration files because it lacks templating capabilities.

    Why it's wrong here

    Python ships Jinja2 and similar libraries, and its string handling generates device configurations readily. The claim is tempting because Python is general-purpose rather than a dedicated templating language, yet that generality is exactly what enables configuration rendering.

About these practice questions

One of 1,923 original 350-401 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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 September 2026 · checked against the official Cisco exam blueprint

This 350-401 practice question is part of Courseiva's free Cisco 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 350-401 exam.