exam questions

Exam 350-401 All Questions

View all questions & answers for the 350-401 exam

Exam 350-401 topic 1 question 974 discussion

Actual exam question from Cisco's 350-401
Question #: 974
Topic #: 1
[All 350-401 Questions]



Refer to the exhibit. Which action results from executing the Python script?

  • A. display the output of a command that is entered on that device
  • B. display the output of a command that is entered on that device in a single line
  • C. SSH to the IP address that is manually entered on that device
  • D. display the unformatted output of a command that is entered on that device
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Mizuchan
Highly Voted 1 year, 4 months ago
I think it should be D.
upvoted 6 times
buddhagaut
1 year, 4 months ago
elaborate please?
upvoted 1 times
slacker_at_work
1 year, 3 months ago
The distinction between options A and D lies in the interpretation of "unformatted output" in option D. Option A states that the command's output is displayed, which typically implies that the output is presented as it would appear in a terminal session, with formatting such as line breaks, indentation, and spacing.
upvoted 3 times
slacker_at_work
1 year, 3 months ago
Since the script executes the command and retrieves its output, it's more accurate to say that the output is displayed rather than explicitly stating it's unformatted. Therefore, option A, "display the output of a command that is entered on that device," is a more suitable choice than option D.
upvoted 4 times
...
...
...
Mizuchan
1 year, 4 months ago
Actually never mind... :<
upvoted 1 times
...
...
Abbribas
Most Recent 6 months ago
Selected Answer: D
The output of the command executed on the remote device is streamed line by line via the stdout variable. Each line is printed with print(u) inside the loop. Since no specific formatting or processing is applied to the output, "unformatted" might also be a valid way to describe the result.
upvoted 2 times
...
a67c04a
7 months, 1 week ago
Selected Answer: D
I go with D - same question as 1024.
upvoted 1 times
...
zbeugene7
8 months, 2 weeks ago
D is correct answer , there is a difference betweem formatted and unformatted output and no formatting is applied to the output in this case , what is the purpose of this question ? This is a primitive script , ping the IP , SSH to the host if it's reachable , run the command entered earlier, check the unformatted results , why is this question in CCNP exam ? CCNA has more difficult questions , what is that special knowledge correct answer to this question proves that a network engineer must have to be a professional compared to that of an associate ?
upvoted 1 times
...
peer1024
9 months, 2 weeks ago
Selected Answer: D
#! /usr/bin/env python3 from pythonping import ping import paramiko import sys import time s = "%s %s" % (sys.argv[1],'') s1 = s.replace(' ','') ip = s1 t = "%s %s" % (sys.argv[2],'') #PYTHON ping needs root ! #r = ping(s1, count=7) #r1 = r.succes() #if r1 != True: # print (ip + " - no ping possible") # exit client = paramiko.client.SSHClient() client.load_system_host_keys() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect(ip, username=USER, password=PSWD, port=22) stdin, stdout, stderr = client.exec_command(t +'\n') time.sleep(3) print(t) for u in stdout: print(u, end='') #print(u) client.close
upvoted 2 times
...
CiscoTerminator
10 months ago
are we software devs now? so in network devOps what will the questions be?
upvoted 2 times
...
[Removed]
1 year ago
Selected Answer: A
A is correct
upvoted 1 times
...
supershysherlock
1 year, 3 months ago
Selected Answer: A
Based on the available information, the script is designed to execute a command on a remote device over SSH and print the output. So the correct answer is: A. display the output of a command that is entered on that device
upvoted 3 times
...
NazgulNr5
1 year, 4 months ago
It also does SSH to the device entered, if the ping succeeds. BTW, this is a terrible Python code.
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...