I have a problem with my code. I have 3 functions, one of them uses an input method called tweet but when I call the function of the error and it does not execute, maybe I did not understand this part of input methods right but I reviewed it a few times and for me it seems to be right. >
I read a file with this function:
def le_tweets():
lista = []
file = codecs.open("tweets_prova.txt", encoding='utf-8')
for l in file:
lista.append(l.replace('\n',''))
return lista
I get the value of the previous function and return to by a variable after
def carregaTweets():
lista = ''
lista = le_tweets()
return lista
And this function to separate text by words
def separa_palavras(tweet):
return tweet.split(' ')
I can receive the text from the file I read, however when I use the separates_words (tweet) from the error and I do not know what to change to solve.
tweet = carregaTweets()
lista = separa_palavras(tweet)
print(lista)