exam questions

Exam 200-901 All Questions

View all questions & answers for the 200-901 exam

Exam 200-901 topic 1 question 514 discussion

Actual exam question from Cisco's 200-901
Question #: 514
Topic #: 1
[All 200-901 Questions]



Refer to the exhibit. A developer created a Python script by using the Cisco Meraki API. The solution must:
• Obtain a list of HTTP servers for a network named “net1”.
• Print the response body if the HTTP status code is 200.
• Handle the timeout requests as exceptions, and print Timeout Error next to the exception to stdout.

Which block of code completes the script?

  • A.
  • B.
  • C.
  • D.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
lmqnam
Highly Voted 1 year, 6 months ago
Selected Answer: A
Because of 'Handle the timeout requests as exceptions, and print Timeout Error next to the exception to stdout.', I choose A But the second line in the answer should be .format(e) instead of . Format(e)
upvoted 10 times
...
doiszeroum
Most Recent 9 months ago
Selected Answer: A
chat; except requests.Timeout as e: print("Timeout Error: {}".format(e)) if response.status_code == 200: print(response.text) Correto. O uso de requests.Timeout as e captura a exceção corretamente e formata a mensagem de erro. O código verifica se o código de status é 200 e, se for, imprime o corpo da resposta (response.text).
upvoted 1 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 ...