Skip to main content
PYTHON FUNDAMENTALS / FINAL CAPSTONE

Network Inventory Analyzer.

A fictional MSP has supplied a CSV inventory and monitoring logs. Write a reusable Python report that identifies offline hosts, rejects malformed data and correlates validated alert evidence.

Multi-dataset verificationReal PythonRead-only fictional filesFinal skill demonstration
NORTHSTAR SERVICES / TECHNICIAN WORK ORDER

Your assignment

A fictional MSP has supplied an inventory export and event log. Write a reusable Python analyzer that validates records, correlates known alerts, and returns a defensible report.

The function you write must work against different inventories and logs. You won't be given the final answer. When you're ready, use Check to run five fictional cases in the browser, including missing files, inconsistent data and repeated alerts.

Safe boundaries: All files are temporary and created inside the isolated browser Python runtime. No live endpoints, real devices, customer data or credentials are used. Do not paste secrets into the editor.
ACCEPTANCE CONTRACT
  • 01Define analyze_inventory(csv_path, log_path) with the exact return contract shown in starter code.
  • 02Read a CSV with DictReader and require host, status and latency_ms headers. If missing, return an empty report with error='missing columns'.
  • 03Normalize hostnames to uppercase and statuses to lowercase. Accept only online, offline, unknown, and nonnegative integer latency.
  • 04Count missing/invalid/duplicate host records as invalid rows; track valid_count separately. Never infer healthy status from missing information.
  • 05Only ALERT lines of the form 'ALERT HOSTNAME event_name' count. Deduplicate hostnames and cross-reference against validated inventory. List unmatched alerts separately.
  • 06If the event-log path is missing, keep the validated CSV counts and return error='missing log file'.
  • 07Return the six-key report dictionary in a stable, sorted form. Do not print from analyze_inventory; the verification harness prints its own summary.
FIVE INDEPENDENT CHECKS

One function. Different operating conditions.

These scenarios check behavior, not whether you copied the sample result. The scenarios are disclosed so you can reason about your implementation. Your code is checked locally in the browser; it is not an accredited or proctored exam.

01

Mixed inventory, unknown alert

Normalize uppercase and padded status, reject malformed latency and keep unmatched log hosts separate

02

No offline devices

Produce an empty alert/incident report without inventing failures

03

Malformed and duplicate records

Reject invalid status, negative latency, blank hosts and case-insensitive duplicate hostnames

04

Missing required columns

Return an explicit header error rather than misclassifying incomplete data

05

Missing event log

Keep valid inventory findings and report a missing log source

OPTIONAL / BEFORE THE FINAL PROJECT

Practice the building blocks first.

You shouldn't have to build a complete inventory analyzer from memory after only repairing code. These three independent challenges let you practice CSV headers, device filtering and alert correlation separately. Then return to the full assessment and combine those ideas.

Open three independent practice challenges
JOELEARNS / PYTHON WORKBENCH

Write it. Run it. Understand it.

Practice three independent building blocks before combining them in the final analyzer.

Python 3.14 · in-browser
CHALLENGE PREP 01 / 3 · INTERMEDIATE

Confirm a CSV export has the columns you need

Independent build: Write headers_ok(csv_text), a function that returns True only when the CSV header contains host, status and latency_ms (in any order). Return False for missing columns or empty input. Use csv.DictReader and StringIO. The sample should print 'True / False'.

EXPECTED OUTPUTTrue / False
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.

How to work: Write the analyzer inside the editor, choose Run to inspect your code, then choose Check to evaluate the five different scenarios. The starter includes a function contract but intentionally does not implement the pipeline. Only the five automated checks passing records a browser-local verification flag.

Need to review a concept? Read Python for IT Automation → or revisit Files, Exceptions & Modules →.

JOELEARNS / PYTHON WORKBENCH

Write it. Run it. Understand it.

Write one analyzer and check it against five different temporary CSV and log scenarios. A memorized output cannot pass.

Python 3.14 · in-browser
CHALLENGE FINAL / 1 · CAPSTONE

Network Inventory Analyzer — Final Python Capstone

A fictional MSP has supplied an inventory export and event log. Write a reusable Python analyzer that validates records, correlates known alerts, and returns a defensible report. Define analyze_inventory(csv_path, log_path) with the exact return contract shown in starter code. Read a CSV with DictReader and require host, status and latency_ms headers. If missing, return an empty report with error='missing columns'. Normalize hostnames to uppercase and statuses to lowercase. Accept only online, offline, unknown, and nonnegative integer latency. Count missing/invalid/duplicate host records as invalid rows; track valid_count separately. Never infer healthy status from missing information. Only ALERT lines of the form 'ALERT HOSTNAME event_name' count. Deduplicate hostnames and cross-reference against validated inventory. List unmatched alerts separately. If the event-log path is missing, keep the validated CSV counts and return error='missing log file'. Return the six-key report dictionary in a stable, sorted form. Do not print from analyze_inventory; the verification harness prints its own summary.

EXPECTED OUTPUT5 scenario checks completed
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.

Temporary virtual files: Files made with open() live only in the browser Python runtime. They can remain between runs in this tab until the runtime resets, but are not your computer files or durable downloads. Each task creates fictional sample inputs. Do not enter secrets.

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.