New course! Every coder should learn Generative AI!
Try a free lesson+ 1
your code counts punctuation marks.
import re
import math
phrase = input()
count_words = len(phrase.split())
only_charac = phrase.replace(' ', '')
only_charac = len(''.join(re.findall('[A-Za-z]', only_charac)))
print(math.ceil(only_charac / count_words))