Skip to content

Python program that allows users to count either the number of words or characters in a given text.

Notifications You must be signed in to change notification settings

CyberSphinxxx/SimplePythonWordCharacterCounter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Simple Python Text Counter


Text Counter Program Description:

This Python program allows users to count either the number of words or characters in a given text.

Users can choose between word count ('w') or character count ('c').


User Input Prompt:

The program prompts the user to enter their text and choose whether they want to count words or characters.


Counting Logic:

Based on the user's choice, the program calculates either the word count (using split()) or the character count (using len()).


Result Display:

After counting, the program displays the count (word count or character count) to the user.


Repeat Option:

The program asks the user if they want to count again. If the user chooses not to continue ('n'), the program exits the loop.


Usage:

Execute the program in a Python environment. Follow the prompts to enter your text and choose whether you want to count words or characters. You can continue counting by entering 'y' or exit the program by entering 'n'.

About

Python program that allows users to count either the number of words or characters in a given text.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages