I'm trying to loop through a list of strings and match/print out any of those strings against a dictionary of words. I seem to get the following error and not too sure why.
Error: TypeError: 'in ' requires string as left operand, not list
Here is the current code i'm working with:
data = ["Great price on the dewalt saw", "cool deal, love it", "nice find", "definitely going to buy"]
words = {'price': ['price', 'compare', '$', 'percent', 'money']}
for d in data:
for word in words.values():
if word in d:
print('Results:')
print(d)
Ideally i'd like to print out all strings that contain any of the price key values.