The following dictionary gives the word and its value:
keywords = {'alone': 1, 'amazed': 10, 'amazing': 10, 'bad': 1, 'best': 10, 'better': 7, 'excellent': 10, 'excited': 10, 'excite': 10}
Following the dictionary are two tweets in a list in a list. For each tweet, we need to find which of the words from keywords are present in it.
tweets = [['work', 'needs', 'to', 'fly', 'by', '', "i'm", 'so', 'excited', 'to', 'see', 'spy', 'kids', '4', 'with', 'then', 'love', 'of', 'my', 'life', '', 'arreic'], ['today', 'is', 'going', 'to', 'be', 'the', 'greatest', 'day', 'of', 'my', 'life', 'hired', 'to', 'take', 'pictures', 'at', 'my', 'best', "friend's", 'gparents', '50th', 'anniversary', '60', 'old', 'people', 'woo']]
The target is to find the sum of the keyword values found in each tweet line.
The code created needs to be a loop because there are more than 2 tweets. I do not understand how I should execute this process.
Appreciate your insight!