Computer Science, asked by udayz, 3 months ago

write a programm in python to count the no of sentences in a large string?​

Answers

Answered by himanshu2006vps
1

import re

# initializing string

test_string = str(input())

# printing original string

print ("The original string is : " + test_string)

# using regex (findall())

# to count words in string

res = len(re.findall(r'\w+', test_string))

# printing result

print ("The number of words in string are : " + str(res))

Similar questions