Courseiva
Question 1,028 of 1,420
mediumMultiple ChoiceObjective-mapped

350-401 Practice Question: Examine the following Python script that uses the…

Examine the following Python script that uses the netmiko library to send configuration commands to a Cisco IOS-XE device:

```python

from netmiko import ConnectHandler

device = { 'device_type': 'cisco_ios', 'ip': '192.168.1.1', 'username': 'admin', 'password': 'cisco',

}

connection = ConnectHandler(**device) config_commands = [ 'interface GigabitEthernet1/0/1', 'description Link to Core', 'ip address 10.1.1.1 255.255.255.0', 'no shutdown'

]

output = connection.send_config_set(config_commands)

print(output)

connection.disconnect() ```

What is the purpose of this script?

⚠ Common exam trap

Cisco often tests the distinction between `send_command()` (for show commands) and `send_config_set()` (for configuration commands), leading candidates to mistakenly think the script retrieves the running config when it actually applies changes.

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

It configures interface GigabitEthernet1/0/1 with a description, IP address, and enables it.

The script uses Netmiko's `send_config_set()` method to push a list of configuration commands to the device. The commands configure interface GigabitEthernet1/0/1 with a description, assign an IP address, and issue `no shutdown` to enable the interface. This matches option B exactly.

Answer analysis

Option-by-option breakdown

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

  • It retrieves the running configuration of the device.

    Why it's wrong here

    send_config_set is used for sending configuration commands, not retrieving config.

  • It configures interface GigabitEthernet1/0/1 with a description, IP address, and enables it.

    Why this is correct

    The commands configure the interface as described.

  • It saves the configuration to the startup configuration.

    Why it's wrong here

    No write memory command is included in the config_commands list.

  • It tests connectivity to the device using ping.

    Why it's wrong here

    The script does not perform any connectivity tests.

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: Jul 4, 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.