We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Status Code Property

The response object from pyfetch has a .status property that contains the status code of the response.

Assignment

Update the get_user_code function to return the status code of the response.

You get a 404 response when requesting a user for an ID that doesn't exist!

Tip

The .ok property of a response indicates whether a response was successful (in the range of 200 - 299) or not.