Lab 2 of 5
Β·
Guided
Build a Device List and Access Elements
Objective: Create a list of hostnames and access specific items by index.
Instructions
Open python3 in your terminal. Run each line below one at a time:
devices = ["sw-core-01", "sw-access-01", "sw-access-02", "rtr-edge-01"]
devices[0]
devices[-1]
devices[1:3]
len(devices)
The first line creates the list and produces no output. The next four lines each produce a result.
Paste only the four output lines below and submit.
π‘ Show Hint
devices[0] is the first item. devices[-1] is the last item. devices[1:3] gives items at index 1 and 2 β not including 3.
Paste Your Output