exam questions

Exam 350-901 All Questions

View all questions & answers for the 350-901 exam

Exam 350-901 topic 1 question 42 discussion

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

DRAG DROP -
Drag and drop the expressions from below onto the code to implement error handling. Not all options are used.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:

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
FR99
Highly Voted 3 years, 3 months ago
Agree with 'if response == 201:' & 'else:'
upvoted 28 times
...
blezzzo
Highly Voted 3 years, 3 months ago
I agree. If response ==201 and else
upvoted 5 times
...
whipmuffin
Most Recent 6 months, 2 weeks ago
The closest answer is `if status == 201:` & `else:` as everyone already stated. The problem here is the `status` variable is no where to be found. This is probably a typo, the correct statement should be `response.status_code == 201`
upvoted 4 times
...
Teringzooi
1 year, 2 months ago
Correct If response 201 Else
upvoted 1 times
...
designated
1 year, 3 months ago
- The body of if is executed only if this evaluates to create the route or if the status is equal to 201 if = status == 201 (HTTP 201 is CREATED) = correct - So, if the route is I52not be created, the body of else is executed else: = correct Note: if-else statement evaluates the Boolean expression. If the condition is TRUE then, the code present in the “ if “ block will be executed otherwise the code of the “else“ block will be executed Wrong if response == 601 = there is no 6xx HTTP code elif is used to include multiple conditional (and it is not this case) when is used to run a block of code whenever, during the execution of the program, a condition is met or related to an event (and it is not this case)
upvoted 2 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 ...