Skip to main content
PRACTICE / PROGRAMMING / PYTHON 08

IT Automation Coding Clinic.

Apply your Python skills to six simulated IT tasks. No network connection, account, credentials or external devices are required.

6 coding challengesReal PythonVariable tracingOffline fixtures

Think like a technician: Make decisions based on status and evidence, reject malformed rows, return predictable results, and test boundaries. Each code challenge runs in the isolated browser Python environment.

Review the lesson →
JOELEARNS / PYTHON WORKBENCH

Write it. Run it. Understand it.

Use offline API fixtures, data validation, log evidence and assertions to build reliable read-only IT workflows.

Python 3.14 · in-browser
CHALLENGE 01 / 6 · BEGINNER

Classify simulated API responses

Write classify_response(status_code) for a fictional API: 200 returns 'ok'; 401 returns 'authenticate'; 403 returns 'forbidden'; codes 500 or higher return 'server_error'; all other statuses return 'review'. Call it for 200, 401, 403, 503 and 404. Print exactly 'ok,authenticate,forbidden,server_error,review'. Do not send requests.

EXPECTED OUTPUTok,authenticate,forbidden,server_error,review
script.py editableCtrl / Cmd + Enter to run
Your code is stored only in session storage when enabled. Never paste secrets. Clearing this option clears saved drafts, not the editor.
Code executes only when you choose Run or Check. No account needed.
HINTS · OPTIONAL

Try solving it before asking for help. Hints never show a completed program.

PYTHON OUTPUTReady

Your printed output and errors will appear here.

VARIABLE TRACER

Run the code, then step through the executed lines to watch variable values change.

About this environment: The Python runtime is loaded on demand from a version-pinned CDN and runs inside a sandboxed, opaque-origin browser frame. Runs have a time limit. OS/network automation is outside this introductory workbench. If your code calls input(), a response panel appears to supply text to those calls. Don't paste secrets or untrusted scripts.