Question: 1 . Convert the string to a list. 2 . Create a loop through the list 3 . for each line in the list add
Convert the string to a list.
Create a loop through the list
for each line in the list add the text 'line followed by line number
print each line using string concatenation
lldp A:STTLWAGANGB# show system lldp neighbor
Link Layer Discovery Protocol LLDP System Information
NB nearestbridge NTPMR nearestnontpmr NC nearestcustomer
Lcl Port Scope Remote Chassis ID Index Remote Port Remote Sys Name
cNB FC:::A::etTAMPFLXEMSE
c NB FC:::::GbE to STTL DLLSTXMSE
cNB E::::: HundredGigE STTLWAGAMSE
indicates that the corresponding row element may have been truncated.
Number of neighbors :
A:STTLWAGANGB#
Exercise
Convert the string to a list.
Slice the list to include only the lines that contain LLDP neighbor data lines, only the data within the table
Print the list using a loop
lldp A:STTLWAGANGB# show system lldp neighbor
Link Layer Discovery Protocol LLDP System Information
NB nearestbridge NTPMR nearestnontpmr NC nearestcustomer
Lcl Port Scope Remote Chassis ID Index Remote Port Remote Sys Name
cNB FC:::A::etTAMPFLXEMSE
c NB FC:::::GbE to STTL DLLSTXMSE
cNB E::::: HundredGigE STTLWAGAMSE
indicates that the corresponding row element may have been truncated.
Number of neighbors :
A:STTLWAGANGB#
PreviousNext
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
