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

Network Discovery & Connectivity.

Write seven independently checked Python helpers to validate device data, select scoped targets, interpret transport results, compare DNS answers, parse command output, correlate service layers and summarize the fleet.

7 real Python challengesAltered input fixturesSafe fictional addressesNo live probes

Real Python, no live network: Exercises execute Python against fictional device inventories, IP addresses and recorded responses in an isolated browser runtime. TCP, DNS and SSH responses are simulated inputs; these challenges do not open sockets, connect to devices, or ask for credentials. Use the separate localhost project in the lesson for a real but local TCP demonstration.

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 / 7 · INTERMEDIATE

Validate a network inventory export

Implement parse_targets(text). Parse a CSV string with exactly three unique headers: host, ipv4 and site (any column order). Reject malformed headers, extra/missing row fields, invalid IPv4 addresses, blank host/site and duplicate hostnames ignoring whitespace/case. Return None for any invalid input. Otherwise return a list of dictionaries with host uppercase, ipv4 canonical string, site uppercase, sorted by host; empty valid CSV returns []. Do not perform any network activity. Print the sample hostnames separated by commas.

EXPECTED OUTPUTAPP-01,DB-02
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.

Use the shared Continue Your Learning Path panel below to mark Practice complete. Your next guided milestone is Lesson 03, IT Service Integrations. Complete this Practice milestone before moving to that lesson.

CONTINUE YOUR LEARNING PATH · AUTOMATING IT OPERATIONS

Ready for Phase 03?

You've reached the end of this Practice module. The next guided step is IT Service Integrations. 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 5 of 12.

Your completion marks are saved in this browser only.