In assignment 1, problem 5 I am still not figuring out how to do the iteration. I managed to sort the correct result with this code: (…) number_of_happy_tweets = number_of_happy_tweets
perform the calculations here
tweets_not_with_happy_words = 4
for word in tweets:
for word in happy_words:
if word not in tweets:
number_of_happy_tweets = number_of_tweets - tweets_not_with_happy_words
print(number_of_happy_tweets) .
But this is not a correct loop iteration, given that I declare a variable and the calculation is based only on variable declaration. How can I unstuck…?!