Stop words
Python
stopwords = [
'I',
'as',
'to',
'you',
'your',
'but',
'be',
'a',
]
paragraph = 'I want to figure out how I can be a better power napper'
def stopwords_stripped(paragraph, stopwords):
words_list = paragraph.split(' ')
cleaned_list = [word.lower() for word in words_list if word not in stopwords]
cleaned_str = ' '.join(cleaned_list)
return cleaned_str
print(stopwords_stripped(paragraph, stopwords))
Output
Embed on website
To embed this program on your website, copy the following code and paste it into your website's HTML:
Comments
This comment belongs to a banned user and is only visible to admins.
This comment belongs to a deleted user and is only visible to admins.