Status Code Classifier
Write a function that classifies an HTTP status code into its category — Informational, Success, Redirection, Client Error, or Server Error — based on its numeric range.
What the problem means: every HTTP status code falls into one of five ranges (1xx-5xx); this checks you understand what each range means, independent of any specific request.
Approach: compare the code against the five ranges from the notes (1xx, 2xx, 3xx, 4xx, 5xx) and return the matching category name.
Input: One line: a 3-digit HTTP status code.
Output: One line: Informational, Success, Redirection, Client Error, or Server Error.
404
Client Error
- 100 <= code <= 599
Hint 1
1xx = Informational, 2xx = Success, 3xx = Redirection, 4xx = Client Error, 5xx = Server Error.
Hint 2
Range comparisons work well: e.g. 200 <= code < 300 checks the 2xx range.
Each HTTP status range maps to one category: 100-199 Informational, 200-299 Success, 300-399 Redirection, 400-499 Client Error, 500-599 Server Error. A chain of range checks (100 <= code < 200, 200 <= code < 300, ...) picks the matching category directly from the notes' status-code table.