June 2018
Intermediate to advanced
294 pages
7h 5m
English
A dictionary is a list of items with key and value pairs. The best way to describe it is by using examples. Let's start:
hosts_dictionary = { 'Srv-001':'10.0.0.100', 'Srv-002':'10.0.0.100'}
hosts_dictionary = { 'Srv-001':'10.0.0.100', 'Srv-002':'10.0.0.101'}hosts_dictionary['Srv-003'] = '10.0.0.103'print hosts_dictionary
hosts_dictionary = { 'Srv-001':'10.0.0.100', 'Srv-002':'10.0.0.101'}hosts_dictionary['Srv-002'] = '10.0.0.122'print hosts_dictionary
hosts_dictionary ...