I am new to Python and am attempting to write a program that tells me which of the lists in a list of lists contains the most word matches to another list. I'd like the output to be a dictionary that contains keys that are numbers which correspond to the number of the list (from the list of lists) and values which are the number of matches between the key list and the comparison list.

I've tried using several different methods of counting and have only been able to successfully get one to display the number of matches. That method is:

```
words = ['red', 'blue', 'yellow', 'black']

list1 = ['the', 'black', 'dog']

list2 = ['the', 'blue', 'blue', 'dog']

results1 = 0

results2 = 0

for w in words:

        results1 += list1.count(w)

        results2 += list2.count(w)

```

results1

1

results2

2

How can I turn this into a dictionary with the structure (list1:1, list2:2, etc...)

My inputs are going to be a list of 26 lists, rotationssplitlist, and a reference list of words, word\_list.

Optimally, I'd like to write this as a dictionarycomp. So, something like:

```
matchdict = {[i for i in range(len(rotationssplitlist)-1)]: [word_list.count(rotationssplitlist[i] for i in range(len(rotationssplitlist)-1)]}

```