Python Prompts Free Prompt

Python Script to Generate a Word Frequency Counter

Write a Python script that counts word frequency in a text file
☆ Save
Prompt
You are a Python developer. Write a script that reads a text file and outputs the most frequent words. Use collections.Counter. The script must: 1) Accept file path, 2) Remove punctuation and stop words, 3) Count word frequencies, 4) Output top N words with counts, 5) Generate a bar chart, 6) Save results to CSV, 7) Handle large files. Add comments.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.