Computer Science, asked by rupasanfui47, 10 months ago

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 subhashishnabajja619
2

Explanation:

This code is in c++. Here we are using the string library. Hope it helps.

Attachments:
Answered by Anonymous
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