dict_1 = dict(a='many', b='words')
len([x for x in str_.split() if x in list(dict_1.values())])
len(set(str_.split()).intersection(list(dict_1.values())))
len(set(str_.split()) & set(dict_1.values()))
words = str_.lower().split()
dict_words = map(str.lower, list(dict_1.values()))
Count the number of words in a string by using a dictionary using a csv file in Python