Computer Science, asked by cheenupanchi2003, 7 months ago

Write a program that should prompt user to type some sentences followed by "enter".It should
then print the original sentence(s) and the following statistics relating to the sentence(s):
A Number of words
Number of characters (including white-space and punctuation)
Percentage of characters that are alpha numeric
3. Write a program that should prompt the user to type some sentence(s) followed by "enter. It should​

Answers

Answered by aratimishra162
1

Explanation:

Can you please explain me

Answered by prakharagrawal6055
2

Answer:

sen=input("Enter any sentence:")

words=1

ch=len(sen)

alnum=0

for i in sen:

   if i==" ":

       words+=1

   if i.isalnum():

       alnum+=1

percent=(alnum/ch)*100

print("Original sentence:",sen)

print("Number of words:",words)

print("Number of characters including everything:",ch)

print("Percentage of alpha numeric characters:",percent,"%")

Explanation:

Similar questions