Your hunch was not wrong; you just forgot to add and assign back self.counts:
counts = []
for word in s_words:
counts.append([word, l_words.count(word)])
self.counts = dict(counts)
What the list understands is essentially; create a list from a loop expression.
You can also translate this into a dictionary understanding:
self.counts = {word: l_words.count(word) for word in s_words}
or better yet, use collections.Counter()an object and save everything that works:
from collections import Counter
def __init__(self:'Collection_of_words', file_name: str) -> None:
''' this initializer will read in the words from the file,
and store them in self.counts'''
with open(file_name) as infile:
self.counts = Counter(infile.read().split())
Counter() , N .