I'm trying to remove the stopwords from a user input string using the .join function. It looks like this:
while True:
line = raw_input()
if line.strip() == stopword:
break
remove_stopwords = ''.join(word for word in line.split() if word not in stop_words)
I've defined stop_words in a list at the top. The problem is that when I type in the string for the stop words to be removed from, it only removes the first word and leaves the rest. Any help would be great. I'm new to this so it's probably something stupid.
stopworddeclared? - msturdy