The Word Counter project is a Python-based program that counts the number of words in a given sentence or paragraph. This project was developed as part of a Python programming internship to strengthen understanding and application of core Python concepts such as input handling, string manipulation, function creation, and error handling.
1. User Input: The program prompts the user to enter a sentence or paragraph.
2. Word Count Logic: A function is implemented to count the number of words in the user input.
3. Error Handling: Accounts for empty inputs and displays an appropriate message.
4. User-Friendly Interface: Provides clear and concise prompts for input and output display.
5. Code Comments: The code is fully documented with comments explaining key parts of the logic.
- Learn how to handle user input in Python.
- Explore string manipulation techniques to efficiently process text.
- Practice function creation for modular programming.
- Implement basic control flow for structured logic.
- Provide a clear output displaying the word count.
- Python 3.x
1. Clone the repository: git clone https://github.com/yourusername/word-counter.git
2. Navigate to the project directory: cd word-counter
3. Run the Python script: python word_counter.py
- The program will prompt you to enter a sentence or paragraph.
- After inputting the text, press Enter.
- The program will output the total number of words in the text.
Enter a sentence or paragraph:
This is a test sentence.
Output:
Word Count: 5
If you'd like to contribute, feel free to fork the repository and submit a pull request. Any suggestions or improvements are welcome!