write a program to input a sentence and find and display the number of words present in the sentence and the number of letters present in the sentence. please write the whole program
Answers
Answered by
2
Explanation:
This code is in c++. Here we are using the string library. Hope it helps.
Attachments:
Answered by
2
Answer:
hi...its a python code...
Explanation:
s=str(input("enter the string"))
l=list(s)
s2=s.split()
print(s2)
print(l)
words=0
letters=0
for i in l:
letters+=1
letter=letters-(s.count(" "))
print(letter,"are the number of letter present in the string")
for i in s2:
words+=1
print(words,"are the number of words present in the string")
hope it helps you
please mark brainliest
Similar questions
Computer Science,
5 months ago
English,
5 months ago
Geography,
10 months ago
Math,
1 year ago
Psychology,
1 year ago
Math,
1 year ago