djfz-2020-s450026/TaskD03/D03.py

13 lines
287 B
Python
Raw Normal View History

2020-12-06 23:49:28 +01:00
import re
import sys
def count_words(string):
capital = len(re.findall(r"\b[A-ZĄĆĘŁŃÓŚŹŻ]+\w*", string))
lower = len(re.findall(r"\b[a-ząćęłńóśźż]+\w*", string))
return str(lower) + " " + str(capital)
for line in sys.stdin:
print(count_words(line))