Your task for today is to create a text analysis tool in Python that analyzes word frequency in user-provided text. This project strengthens your ability to work with strings, dictionaries, and file handling while building practical text processing skills.
Project Task
The program should:
Accept text input from the user (or read from a file)
Clean the text by removing punctuation and converting to lowercase
Count the frequency of each word
Display the most common words in a formatted report
Show basic text statistics (total words, unique words, etc.)
Bonus (optional):
Filter out common stop words (the, and, of, etc.)
Create a simple bar chart of word frequencies
Save results to a file
Find the longest and shortest words
This project gives you hands-on practice with dictionaries, string processing, and data analysis — essential skills for text mining, content analysis, and natural language processing.
Expected Output
Enter your text: The quick brown fox jumps over the lazy dog. The fox is quick and the dog is lazy.
=== Word Frequency Analysis ===
Total words: 16
Unique words: 11
Average word length: 3.8
Top 5 Most Common Words:
1. the: 3 times (18.75%)
2. is: 2 times (12.50%)
3. fox: 2 times (12.50%)
4. lazy: 2 times (12.50%)
5. quick: 2 times (12.50%)
Longest word: jumps (5 letters)
Shortest word: is (2 letters)
💻 Launch This Project in Colab
Open the interactive Google Colab notebook for today's project — with full instructions, hints, and solutions.
Click the button below to start coding — no setup needed: