The expected output is correct. So, there is no mistake with the lab.
Please check if you are doing the following:
- Split sentence based on whitespace to produce a list of words
- For each word in this list, add it to a new list if it’s not a stopword
- Use string
.join
method to create and return a new sentence that’s void of stopwords.