djfz-2020-s444344/TaskD03/run
Zofia Bączyk b3f0171aeb atempt 1
2020-12-06 18:00:40 +01:00

19 lines
360 B
Python

#!/usr/bin/python3
import sys
import re
for line in sys.stdin.readlines():
answer = re.findall('([\W]|^)[a-ząćęłńóśźż][\w]*',line)
temp = ''
if answer:
temp += (str(len(answer))+" ")
else:
temp += "0 "
answer = re.findall('([\W]|^)[A-ZĄĆĘŁŃÓŚŹŻ][\w]*',line)
if answer:
temp += str(len(answer))
else:
temp += "0"
print(temp)