Lab 3 of 5
Β·
Semi-Guided
Use Your Module to Process a Device List
Objective: Import device_utils and use both functions to process a list of raw hostnames.
Instructions
Using the device_utils.py module you created in Lab 2, create a file called lab3.py that:
- Imports
device_utils - Loops through this list of raw hostnames:
python raw = [" SW-CORE-01 ", "rtr-edge-01", "fw-dmz-01", " SW-ACCESS-01 "] - For each hostname: formats it using
format_hostname, gets the type usingget_device_type, then prints:<formatted_name> β <type>
Run python3 lab3.py. Paste your output below and submit.
π‘ Show Hint
Call format_hostname first to clean the name, then pass the cleaned name to get_device_type. Chain the results into the print statement.
Paste Your Output