TypeError: 'int' object is not iterable

I keep getting this when I’m trying to do the tweets problem. Can anyone help? what is wrong with my code?
TypeError Traceback (most recent call last)
4 # perform the calculations here
5 for word in happy_words:
----> 6 for word in tweets:
7 if word in tweets:
8 number_of_happy_tweets = number_of_happy_tweets +1

TypeError: ‘int’ object is not iterable

1 Like
for word in range(happy_words):
    for word_1 in range(tweets):  #can't use the same variable in nested loop
        number_of_happy_tweets = number_of_happy_tweets +1

@yaocullen try maybe this will work.