The Word Counter program is a simple Python script designed to count the number of words in a given sentence or paragraph. This project helps reinforce Python programming concepts such as input handling, string manipulation, function creation, and basic error handling.
- User Input: Prompts the user to enter a sentence or paragraph.
- Word Counting Logic: Splits the input text into words and counts them.
- Error Handling: Handles cases where no input is provided.
- User-Friendly Output: Clearly displays the word count in a readable format.
- Python 3.x
- Ensure you have Python installed on your system.
- Download or copy the
word_counter.pyscript. - Open a terminal or command prompt.
- Navigate to the directory containing the script.
- Run the script using the command:
python word_counter.py
- Enter a sentence or paragraph when prompted.
- The program will display the word count.
Welcome to the Word Counter Program!
Enter a sentence or paragraph: Python programming is fun and educational.
Word Count: 6