I have a list of dictionaries.
Keys in every dictionary in the list have another dictionary as a value.
[{'A':{'AX':'','source':'rock'}},
{'B':{'BX':'','source':'paper'}},
{'C':{'CX':'','source':'scissors'}}]
['rock','paper','scissors']
If dlist
is your list of dictionaries, then:
values = set([list(d.values())[0]['source'] for d in dlist])
Additionally, if you don't care about mutating the dictionaries, you can also do this:
values = set([d.popitem()[1]['source'] for d in dlist])