Question 1 of 5

How do you validate a model response in JSON?

The helper answers how long to wait before retrying. One response says −5 seconds. Another cites an instruction it never received.

Suppose an app needs to display a discounted price. It receives valid JSON with the word “free” in the price field. The message parses successfully, but the app cannot multiply that word by 0.9. Check that the value suits the operation the app will perform next.

WHERE TO START

Name a field your application needs before it can display the result.

What to know before this question
Topic example · Response status

Change 200 to 404. What will the program print?

status = 200
print(status == 200)
Line notes
  1. Store a service response code.
  2. Compare the code with 200 and print the result.

How would you rate your understanding?

This is your self-assessment. Progress is saved in this browser.

Not rated yet

← Back to Python and APIs