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
1
Explanation:
Can you please explain me
Answered by
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
English,
3 months ago
Computer Science,
3 months ago
Math,
3 months ago
Math,
7 months ago
Geography,
7 months ago
Social Sciences,
11 months ago
Economy,
11 months ago