positive_list = [line.strip() for line in open('positive-words.txt')] #converts text file to list
target_list = ['title', 'trump', 'impeached', 'for', 'abuse', 'of', 'power', 'two', 'weeks', 'before']
def wordcount(target_list, target_string):
counter = 0
for string in target_list:
if string == target_string:
counter += 1
else:
print('No matches found')
break
print('Number of matches: ' + counter)
wordcount(target_list, positive_list[x])
Я смог выполнить поиск target_list с помощью строкового объекта, но не смог l oop по всем строкам, содержащимся в списке positive_list.
Есть ли способ для l oop через target_list с positive_list?