djfz-2023-s473575/TaskF03/run.py
2024-01-07 12:16:30 +01:00

14 lines
330 B
Python

import re
import sys
def analyze_line(line):
lowercase_words = re.findall(r'\b[a-ząćęłńóśźż]\w*\b', line)
uppercase_words = re.findall(r'\b[A-ZĄĆĘŁŃÓŚŹŻ]\w*\b', line)
result = f'{len(lowercase_words)} {len(uppercase_words)}'
return result
for line in sys.stdin:
print(analyze_line(line))