Skip to content

Latest commit

 

History

History
29 lines (26 loc) · 1.21 KB

exercise1.md

File metadata and controls

29 lines (26 loc) · 1.21 KB

Day 2 Recap Exercise 1

Process the 'exercise1.txt' file and create a data structure from it.

  1. Create a dictionary of dictionaries.
  2. The keys for the outermost dictionary should be the interface names.
  3. The value corresponding to this interface name is another dictionary with the fields 'ip_address', 'line_status', and 'line_protocol'.
  4. Use pretty-print to print out your data structure. Your output should be similar to the following:
{'FastEthernet0': {'ip_address': 'unassigned',
                   'line_protocol': 'down',
                   'line_status': 'down'},
 'FastEthernet1': {'ip_address': 'unassigned',
                   'line_protocol': 'down',
                   'line_status': 'down'},
 'FastEthernet2': {'ip_address': 'unassigned',
                   'line_protocol': 'down',
                   'line_status': 'down'},
 'FastEthernet3': {'ip_address': 'unassigned',
                   'line_protocol': 'down',
                   'line_status': 'down'},
 'FastEthernet4': {'ip_address': '10.220.88.20',
                   'line_protocol': 'up',
                   'line_status': 'up'},
 'Vlan1': {'ip_address': 'unassigned',
           'line_protocol': 'down',
           'line_status': 'down'}}