Suppose I have a dictionary (dict) with keys and values as below:
print(dict)
{'AAA': {'', '111', '222'}, 'BBB': {'222', '999', '555'}}
I want to extract the values from the dictionary in the form of a single string, i.e. type(values) = str
, such as:
values = '111', '222', '999', 555'
but what I am getting is below under dict.values()
:
dict.keys()
dict_keys(['AAA', 'BBB'])
dict.values()
dict_values([{'', '111', '222'}, {'222', '999', '555'}])
How can I achieve the required result?