Jun-07-2020, 08:33 PM
In what form are these values? Is it a string?
If so, you can just use them as a dictionary key, and set the value to what you want.
If so, you can just use them as a dictionary key, and set the value to what you want.
>>> d = {} >>> d['1.1.1.1'] = 'A' >>> d['1.2.1.1'] = 'B' >>> d['1.1.2.1'] = 'C' >>> d {'1.1.1.1': 'A', '1.2.1.1': 'B', '1.1.2.1': 'C'}