Question 1,125 of 2,015
Python for Network AutomationmediumMultiple SelectObjective-mapped

Quick Answer

The correct answers are B and D, as dictionaries store key-value pairs for device parameters and lists maintain order for iterating over multiple device names. Dictionaries are ideal for network automation because they map unique keys like IP addresses to corresponding values such as usernames and passwords, enabling efficient configuration retrieval. Lists, being ordered and mutable, allow you to store a sequence of device names or IPs and iterate through them in a loop, which is essential for automating tasks across multiple network devices. On the ENCOR 350-401 exam, this question tests your understanding of which Python data structure fits specific automation use cases—a common trap is confusing tuples (immutable) or sets (unordered) with lists or dictionaries. Remember the memory tip: "Dict for details, List for loops" to quickly recall that dictionaries handle key-value device parameters while lists handle ordered device collections for iteration.

CCNP Python for Network Automation Practice Question

This 350-401 practice question tests your understanding of python for network automation. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Which two statements about Python data structures used in network automation are true? (Choose two.)

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

Dictionaries are used to store key-value pairs such as device IP, username, and password.

Correct answers: B and D. B is correct because dictionaries are ideal for storing key-value pairs such as device parameters (IP, username, password). D is correct because lists are ordered and can hold multiple device names or IPs, and they support iteration. A is incorrect because tuples are immutable, so they cannot be modified after creation, which limits their use for dynamic data. C is incorrect because sets are unordered and do not support indexing; they are used for unique elements, not ordered collections. E is incorrect because strings are immutable and not suitable for storing multiple separate values.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • Tuples are commonly used to store device credentials because they can be modified easily.

    Why it's wrong here

    Incorrect because tuples are immutable; they cannot be modified after creation, making them unsuitable for dynamic credential storage.

  • Dictionaries are used to store key-value pairs such as device IP, username, and password.

    Why this is correct

    Correct because dictionaries map keys to values, which is perfect for storing device parameters like IP, username, and password.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Sets are ordered and allow indexing to retrieve specific elements.

    Why it's wrong here

    Incorrect because sets are unordered and do not support indexing; they are used for unique elements and set operations.

  • Lists are ordered and can be used to store multiple device names for iteration.

    Why this is correct

    Correct because lists maintain order and allow iteration, making them suitable for storing a list of device names or IPs.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Strings are mutable and ideal for storing multiple device configurations.

    Why it's wrong here

    Incorrect because strings are immutable in Python and are not designed to hold multiple separate values; they are single sequences of characters.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Many certification questions include familiar terms but test a specific constraint. Read the exact wording before choosing an answer that is generally true but wrong for this case.

Detailed technical explanation

How to think about this question

This question should be treated as a scenario, not a definition check. Identify the problem, the constraint and the best action. Then compare each option against those facts.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.
  • Use explanations to understand the rule behind the answer.

TExam Day Tips

  • Underline the problem statement mentally.
  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A practitioner preparing for the 350-401 exam encounters this exact type of scenario on the job. The correct answer here is not the most general option — it is the best answer for the specific constraint described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Real exam questions reward reading the full scenario before eliminating options, because the constraint defines which answer fits.

What to study next

Got this wrong? Here's your next step.

Identify which 350-401 exam domain this question belongs to, then review the specific concept being tested. Practise related questions in that domain and focus on understanding why each wrong answer is tempting — not just why the correct answer is right.

Related practice questions

Related 350-401 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free 350-401 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this 350-401 question test?

Python for Network Automation — This question tests Python for Network Automation — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Dictionaries are used to store key-value pairs such as device IP, username, and password. — Correct answers: B and D. B is correct because dictionaries are ideal for storing key-value pairs such as device parameters (IP, username, password). D is correct because lists are ordered and can hold multiple device names or IPs, and they support iteration. A is incorrect because tuples are immutable, so they cannot be modified after creation, which limits their use for dynamic data. C is incorrect because sets are unordered and do not support indexing; they are used for unique elements, not ordered collections. E is incorrect because strings are immutable and not suitable for storing multiple separate values.

What should I do if I get this 350-401 question wrong?

Identify which 350-401 exam domain this question belongs to, then review the specific concept being tested. Practise related questions in that domain and focus on understanding why each wrong answer is tempting — not just why the correct answer is right.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 18, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.