How to use Python sets and add strings to it in as a dictionary value
问题 I am trying to create a dictionary that has values as a Set object. I would like a collection of unique names associated with a unique reference). My aim is to try and create something like: AIM: Dictionary[key_1] = set('name') Dictionary[key_2] = set('name_2', 'name_3') Adding to SET: Dictionary[key_2].add('name_3') However, using the set object breaks the name string into characters which is expected as shown here. I have tried to make the string a tuple i.e. set(('name')) and Dictionary