mediumMultiple ChoiceObjective-mapped
CCNP Practice Question: Examine the following Python script snippet that…
Examine the following Python script snippet that uses netmiko to configure 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) output = connection.send_command('show ip interface brief')
print(output)
connection.disconnect() ```
What is the primary 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 any script that connects to a device is performing configuration 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 retrieves and prints the output of 'show ip interface brief'.
The script uses netmiko's `send_command()` method, which sends a show command to the device and returns the output. It does not include any configuration commands or file transfer operations. Therefore, its primary purpose is to retrieve and print the output of 'show ip interface brief'.
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 configures an IP address on an interface.
Why it's wrong here
The script only sends a show command, not configuration commands.
- ✓
It retrieves and prints the output of 'show ip interface brief'.
Why this is correct
The script connects, sends a show command, prints the output, and disconnects.
- ✗
It saves the running configuration to startup configuration.
Why it's wrong here
There is no write memory or copy command in the script.
- ✗
It backs up the configuration to a TFTP server.
Why it's wrong here
No TFTP transfer is performed.
About these practice questions
One of 1,175 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.