Lesson 17 — Mini project: unique words
Mini project: a tiny word-statistics tool
Real text is messy: "The" and "the" should count as one word, and "dog." should not differ from "dog". Normalise first: lowercase everything and strip punctuation. Then combine structures: a set for unique words and a Counter for frequencies.
"Dog.".lower().strip(".,!?") # "dog"
Why it matters: search engines, spam filters and AI language models all start with exactly this kind of text clean-up.
Normalise each word (lowercase + strip ".,!?"), then build unique with a set. Expected: 7 unique words.
Run your code — when the output matches the task, you will see a green check. Then mark the lesson complete.
A quick 3-question quiz on this lesson — instant feedback.
Ready for more? Optional paid resources that pick up where this lesson leaves off.
Some links on this page are affiliate links: we may earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases.
Project-based Data Structures courses if you want a structured paid path after the free lessons. Wait for a sale — prices drop often.
Browse on Udemy →Search Amazon for Data Structures books — check the publication year so the examples match current versions.
Search Amazon →