⚑ IT Wisdom Security told us to rotate our keys. Now nobody can open any doors.
Skilled Practitioner
4249 XP 1751 to Expert
Objective: Use a set comprehension to extract unique VLAN IDs from a device list.
Instructions

Create a file called lab3.py. Using the device list below, find all unique VLANs and print them sorted. Then print the total count.

devices = [
    {"name": "sw-core-01",  "vlan": 10},
    {"name": "sw-access-01","vlan": 20},
    {"name": "sw-access-02","vlan": 10},
    {"name": "sw-access-03","vlan": 30},
    {"name": "sw-access-04","vlan": 20},
]

Your output must match exactly:

[10, 20, 30]
Unique VLANs: 3

Run it with python3 lab3.py. Paste your output below and submit.

πŸ’‘ Show Hint
Use a set comprehension: vlans = {d["vlan"] for d in devices}. Then print(sorted(vlans)) to get a sorted list. len(vlans) gives the count.
Paste Your Output
Next Lab β†’