0

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="")
eyllanesc
  • 235,170
  • 19
  • 170
  • 241

0 Answers0