Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Cisco Certified DevNet Associate (DEVASC) · Cisco
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
Here's a list of all codes referenced by name in the .codes object: https://2.python-requests.org/en/master/api/#status-code-lookup "Some codes have multiple names, and both upper- and lower-case versions of the names are allowed. For example, codes.ok, codes.OK, and codes.okay all correspond to the HTTP status code 200."
A is correct response.status_code == requests.code.ok response + status_code from library equals requests imported . code from requets library and response code ok
correct, but not pythonic: >>> if response.status_code == requests.codes.ok: ... print("ok") ... ok >>> if response.status_code: ... print("ok") ... ok >>>