⚑ IT Wisdom I told my team to implement TLS everywhere. They added it to the coffee machine. I regret nothing.
Skilled Practitioner
4249 XP 1751 to Expert
Objective: Use pprint to format a list of device dictionaries in a readable layout.
Instructions

Create a file called lab2.py. Print the inventory below using pprint with width=60, then print the total count.

inventory = [
    {"name": "sw-core-01",  "ip": "10.1.1.1",   "site": "HQ",     "vlan": 10},
    {"name": "sw-access-01","ip": "10.1.1.2",   "site": "HQ",     "vlan": 20},
    {"name": "rtr-edge-01", "ip": "10.1.1.254", "site": "HQ",     "vlan": 1},
    {"name": "fw-dmz-01",   "ip": "10.1.2.1",   "site": "DMZ",    "vlan": 100},
]

Your output must match exactly:

[{'ip': '10.1.1.1', 'name': 'sw-core-01', 'site': 'HQ', 'vlan': 10},
 {'ip': '10.1.1.2', 'name': 'sw-access-01', 'site': 'HQ', 'vlan': 20},
 {'ip': '10.1.1.254', 'name': 'rtr-edge-01', 'site': 'HQ', 'vlan': 1},
 {'ip': '10.1.2.1', 'name': 'fw-dmz-01', 'site': 'DMZ', 'vlan': 100}]
Total devices: 4

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

πŸ’‘ Show Hint
from pprint import pprint. Call pprint(inventory, width=60). The dict keys will appear in alphabetical order. Follow with a regular print() for the count.
Paste Your Output
Next Lab β†’