corpus = \
{'a': 'Mr. Green killed Colonel Mustard in the study with the candlestick. \
Mr. Green is not a very nice fellow.',
'b': 'Professor Plum has a green plant in his study.',
'c': "Miss Scarlett watered Professor Plum's green plant while he was away from his office last week."}
def inDictElement(term, corpus):
num_texts_with_term = len([True for text in corpus.values() if term.lower() in text.lower().split()])
if num_texts_with_term == len(corpus):
print '%s Exist in all dict element!' % term
else:
print '%s not Exist in all dict element!' % term
In [35]: inDictElement('green', corpus)
green Exist in all dict element!
In [36]: inDictElement('plum', corpus)
plum not Exist in all dict element!
In [37]: inDictElement('not', corpus)
not not Exist in all dict element!