Question: I need to write python code to help me give word count digit count etc. this is what i have but digit count and sentence

I need to write python code to help me give word count digit count etc. this is what i have but digit count and sentence count is not working. Must use boolean in if statementsI need to write python code to help me give word count

char = input("Please enter text to analyze(press ENTER/return without text to exit): ") count = 0 num_digits = 0 num_letters = 0 num_sentences = 0 num_spaces = 0 length len(char) for char in char: if character is letter (char)== True: num_letters = num_letters+1 elif characterais whitespace cchardman True: num_spaces = num_spaces+ 1 elif characteraends sentence(char ==True: num_sentences = num_sentences +1 elif character is digitaTrue: num_digits num_digits+ 1 count = num_digits+num_sentences+num_spaces+num_letters print() print("Count of characters: + str(count))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!