I've got this code. This code removes the stopwords(in the stopwords.py file) from yelp.py
def remove_stop(text, stopwords):
disallowed = set(stopwords)
return [word for word in text if word not in disallowed]
text = open('yelp.py','r').read().split()
stopwords = open('stopwords.py','r').read().split()
print(remove_stop(text, stopwords))
Currently, the output is a very long string. I want the output to skip a line after every word in the yelp.py file. How do i do that? Can somebody help pls!!
The current output is ['near', 'best', "I've", 'ever', 'price', 'good', 'deal.', 'For', 'less', '6', 'dollars', 'person', 'get', 'pizza', 'salad', 'want.', 'If', 'looking', 'super', 'high', 'quality', 'pizza', "I'd", 'recommend', 'going', 'elsewhere', 'looking', 'decent', 'pizza', 'great', 'price,', 'go', 'here.']
How do i get it to skip a line?