Assignment 1 help

For calculating sad tweets I’m using the code below. But my answer is wrong, its coming out to be 5. Whats wrong with my code, I used the same with happy tweets and the answer is correct. Plz help

number_of_sad_tweets = 0
for word in sad_words:
 for tweet in tweets:
    if word in sad_words:

In my opinion you should reverse the for loops (first iterate over tweets, then over words).

The condition is wrong too:
if word in tweet
You want to check if the word is inside the tweet, not if word is inside sad_words (it will always be because you’re iterating over it).