‘int’ object has no attribute ‘append’

j has been used a a list as well as an integer. Use j only for integer name, name the list to something else.

j.append(filter(isAcceptableChar, j[i]))    # j is not a list here,it is an int.
w.append([word for word in word_tokenize(j[i].lower()) if word not in english_stops])
for j in range (0,len(w[i])):               # here j is an int

Leave a Comment

error code: 523