So I have a dictionary of user preferences that I'd like to check and see if ALL of the dictionary values exist in a list.
For example, I have a dictionary like:
dct = { 'key1' : 'value1', 'key2' : 'value2'}
And I have a list like so:
lst = ['list1', 'list2', 'list3', 'list4']
I'm trying to check if all of the values in the dictionary exist in the list.
How do I do this?
EDIT to be more specific:
My dictionary is
userprefs = {'RON' : 'PHX'}
My list is
poss_matches = [['misc0', 'misc1', 'misc2', 'misc3', 'misc4', 'misc5', 'misc6', 'misc7', 'PHX-']]
However, if I use something like:
for seq in poss_matches:
for p in userprefs:
if userprefs[p] in seq:
matches.append(seq)
I get an empty list for matches.