Courseiva
Question 155 of 1,840
hardMultiple SelectObjective-mapped

350-401 Practice Question: Which three statements about Python functions and…

Which three statements about Python functions and modules for network automation are true? (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

Using functions helps avoid code duplication and improves script maintainability.

Correct answers: A, C, and E. A is correct because functions promote code reuse and readability by encapsulating logic. C is correct because the json module is essential for parsing JSON responses from REST APIs. E is correct because the re module allows pattern matching in device outputs, such as parsing 'show' command results. B is incorrect because the os module is for operating system interactions, not for parsing JSON. D is incorrect because the csv module is for reading/writing CSV files, not for parsing JSON.

Answer analysis

Option-by-option breakdown

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

  • Using functions helps avoid code duplication and improves script maintainability.

    Why this is correct

    Correct because functions encapsulate reusable logic, reducing duplication and making scripts easier to maintain.

  • The os module is used to parse JSON data from network device responses.

    Why it's wrong here

    Incorrect because the os module provides operating system interfaces (e.g., file paths, environment variables); JSON parsing is done with the json module.

  • The json module is used to convert JSON strings to Python dictionaries.

    Why this is correct

    Correct because json.loads() converts a JSON string into a Python dictionary, which is common when working with REST API responses.

  • The csv module is used to parse JSON data from network devices.

    Why it's wrong here

    Incorrect because the csv module handles comma-separated values, not JSON; JSON parsing requires the json module.

  • The re module is useful for extracting specific patterns from device show command output.

    Why this is correct

    Correct because the re module provides regular expression support, which is commonly used to parse and extract data from CLI outputs.

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.