I have a Twitter app that combs for tweets about trending topics. It makes a .txt file (called 'words') that parses every single word in all of the tweets as a string in a list.
Currently, to compare each word in the twitter list to a list of "positive" words, I have:
def p_count(l): #list of strings is object called upon
total = 0
for w in l: #for each word in twitter 'words' list
for x in p_words: #for each word in "positive" words list
if w == x: #compare twitter word to x positive word
total += 1
return total
print p_count(words)
I am getting a result of 0, however I know that there are words like 'humble' and 'strong' that appear in both lists. I am using Enthought Canopy. Any tips?