Define a function called clean_text() that takes in some text as a parameter.
- remove all new line characters
\nfrom the text - remove all
punctuationfrom thetext - convert the entire
texttolowercase - use the
.split()method to split thetextat every space, creating a list of individual words
Finally, return the list of lower case words with no punctuation.
clean_text("How now, Brown Cow?")
output:
['how', 'now', 'brown', 'cow']