Could someone please help me troubleshoot my code. I have two lists.
A = [['2925750', ' Everything he mentioned, I could have evaluated on my own'], ['2925750', ' I do wish he could have shown us more at this point that could have set the fox apart.']]
B = ['mentioned','evaluated','fox','wish']
The goal is to append to list A the number of times any item in B is present in a sentence for A.
The result should be something like:
[(['2925750', ' Everything he mentioned, I could have evaluated on my own'], 0), (['2925750', ' I do wish he could have shown us more at this point that could have set the Equinox apart.'], 0)]
The problem is my count is zero.
Below is my code. Thank you in advance:
Y = []
##Find Matches
for sent in A:
for sent in B:
Y.append((sent, sum(sent.count(col) for col in B)))
Thank you.