exam questions

Exam 350-401 All Questions

View all questions & answers for the 350-401 exam

Exam 350-401 topic 1 question 688 discussion

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

Refer to the exhibit.



What does this Python script do?

  • A. enters the TACACS+ username for a specific IP address
  • B. reads the username for a specific IP address from a light database
  • C. writes the username for a specific IP address into a light database
  • D. enters the RADIUS username for a specific IP address
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
jackr76
Highly Voted 2 years, 1 month ago
WTF is this a Cisco or SQL exam
upvoted 32 times
ando2023
1 year, 10 months ago
I've recertified my ccnp since 2013 a few times, but now Cisco all of a sudden is going off in such a different direction. Switching and routing is now such a small part of the overall requirements.
upvoted 12 times
...
dragonwise
2 years, 1 month ago
They think we're not worthy of the certificate if we do answer this question
upvoted 7 times
mgiuseppe86
1 year, 7 months ago
Thats my biggest gripe with the new CCNP. It's all BS Cloud/WiFi/Automation. WHAT HAPPENED TO REAL LAYER 1 2 3 NETWORKING
upvoted 10 times
...
...
Dre876
1 year, 8 months ago
tell me about it!
upvoted 1 times
...
...
Badger_27
Highly Voted 2 years, 2 months ago
WTF are they serious?
upvoted 12 times
zogerixty
2 years, 1 month ago
Can't understand?
upvoted 1 times
Badger_27
2 years, 1 month ago
No- how are you supposed to if you don't regularly use Python and the SQLite module?
upvoted 5 times
...
...
...
chmacnp
Most Recent 3 months, 1 week ago
Selected Answer: B
nice one slacker_at_work !
upvoted 1 times
...
johndoen
7 months, 1 week ago
I this sql exam or cisco one , I dont see get it just like I wasn't able to roam my globe sim before knowing https://theglobesimregistration.ph
upvoted 1 times
...
AbdullahMohammad251
7 months, 1 week ago
Selected Answer: B
Connect to the SQLite database (user.sqlite) Execute the SQL query (find the username for a given IP address: the IP address stored in the list item with index 'i') Fetch the entire result set and parse it into a Python list (list 'e') Modify the result list - in our example, curly brackets were replaced with double quotes
upvoted 2 times
...
CiscoTerminator
8 months, 3 weeks ago
I wonder what is being asked in devops then, if these are encor questions?
upvoted 2 times
...
Steve122
10 months ago
Selected Answer: B
Definitely 'B'. After getting the username from e[0] it removes the ( and ) chars from string. (nothing written back to DB)
upvoted 1 times
...
[Removed]
11 months, 1 week ago
Selected Answer: B
B is correct The keyword is: c = "select user from monitor branch where loopbackip='" + str(ip[i]) + "'"
upvoted 2 times
[Removed]
10 months, 3 weeks ago
...........................
upvoted 1 times
...
...
[Removed]
11 months, 3 weeks ago
i'm going with B, no idea why :D
upvoted 1 times
...
RickAO76
1 year ago
Selected Answer: C
I'm 50/50 with it being B or C. The two lines for .... usr = usr.replace() ...functions, are for writing. - I honestly just hope I don't see this question :-/
upvoted 2 times
RickAO76
1 year ago
Re-visiting - I'm leaning to B now for read. The replace looks like it's only replacing the special characters.
upvoted 2 times
...
...
slacker_at_work
1 year, 2 months ago
Here's a breakdown of what each part does: -1 Importing sqlite3: This line imports the SQLite3 module in Python, allowing the script to interact with SQLite databases. -2 Connecting to the database: The script connects to a SQLite3 database located at /home/sdwan-lab/user.sqlite3. This is done using the connect() method of the sqlite3 module, which returns a connection object (a in this case). -3 Creating a cursor object: Cursors are used to execute SQL queries on the connected database. The cursor() method creates a cursor object (b in this case) associated with the connection
upvoted 5 times
...
slacker_at_work
1 year, 2 months ago
- 4 SQL Query: The variable c contains an SQL query. It appears to be selecting the user column from a table named monitor_branch where the loopbackip matches a specific pattern. However, there seems to be a syntax error in the query. The string concatenation is not done properly. - 5 Executing the query: The execute() method of the cursor b executes the SQL query stored in the variable c. - 6 Fetching the results: The fetchall() method retrieves all the rows returned by the query execution and stores them in the variable e. - 7 Processing the result: The script then appears to be manipulating the fetched result. It converts the first element of the result (e[0]) to a string, removes any occurrences of ( and ,) from the string, and assigns the modified string back to the variable usr.
upvoted 4 times
Nation_2024
10 months, 1 week ago
Thankyou
upvoted 1 times
...
...
mgiuseppe86
1 year, 7 months ago
doesn the usr.replace string write the username back to the DB once it selects it from the table monitor_Branch?
upvoted 2 times
...
djedeen
1 year, 8 months ago
Selected Answer: B
B: good link here for similar queries from sqlite3 DB. https://pyneng.readthedocs.io/en/latest/book/25_db/sqlite3_fetch.html
upvoted 2 times
...
HungarianDish_111
2 years, 1 month ago
Selected Answer: B
B seems to be correct, because data only needs to be read from the DB, and not altered. https://www.google.com/amp/s/www.geeksforgeeks.org/how-to-list-tables-using-sqlite3-in-python/amp/
upvoted 2 times
...
Sammy3637
2 years, 2 months ago
no clue ... didn't see this coming , not in OCG
upvoted 5 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago