I am trying to count the number of sentences in a text but I do not get the correct number anytime I run this line.
import re
n = input("Text: ")
sent = len(re.split(r'[.!?]+', n))
print(f"{sent}", end="")
I am trying to count the number of sentences in a text but I do not get the correct number anytime I run this line.
import re
n = input("Text: ")
sent = len(re.split(r'[.!?]+', n))
print(f"{sent}", end="")