Skip to main content
PRACTICE / AUTOMATING IT OPERATIONS / LESSON 03

IT Service Integrations.

Write eight independent Python helpers for simulated service-desk responses, safe ticket drafts, exact API scope, stable incident keys, confirmed ticket IDs, controlled alerts, retry decisions and evidence-based handoffs.

8 coding challengesReal PythonAltered test fixturesOffline fictional service data

Real Python, simulated integrations: This isolated workbench evaluates Python using local response dictionaries. It never issues HTTP requests, creates tickets, sends email, calls external APIs or requests credentials. Use the written lesson for the independent offline adapter project.

JOELEARNS / PYTHON WORKBENCH

Write it. Run it. Understand it.

Real Python execution, a variable trace and feedback against the requirements. You write the code—answers aren't revealed up front.

Python 3.14 · in-browser
CHALLENGE 01 / 8 · INTERMEDIATE

Interpret an API response without overstating success

Write api_outcome(status, body). status must be an integer but not a bool. Return 'created' only for HTTP 201 and a dictionary body containing a nonempty string id; return 'queued' only for HTTP 202 and a nonempty string job_id; 'rate-limited' for 429; 'auth-error' for 401 or 403; 'client-error' for 400 or 422; 'server-error' for 500, 502, 503 or 504; and 'unknown' otherwise. Do not treat 200 alone as proof that a ticket was created. Print the sample result.

EXPECTED OUTPUTcreated
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.

After completing the coding clinic, use the shared Continue Your Learning Path panel below to mark this Practice milestone complete. The next guided milestone is Lesson 04, Infrastructure Monitoring; continue using the shared panel, rather than skipping the current coding clinic.

CONTINUE YOUR LEARNING PATH · AUTOMATING IT OPERATIONS

Ready for Phase 04?

You've reached the end of this Practice module. The next guided step is Infrastructure Monitoring. You can review your answers or revisit the lesson, but you don't need to return to the course roadmap to find what comes next. Next: milestone 7 of 12.

Your completion marks are saved in this browser only.