From b3f0171aeb3be299a34cf42aa574d4011f9f0ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zofia=20B=C4=85czyk?= Date: Sun, 6 Dec 2020 18:00:40 +0100 Subject: [PATCH] atempt 1 --- TaskD03/Makefile | 0 TaskD03/run | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 TaskD03/Makefile create mode 100644 TaskD03/run diff --git a/TaskD03/Makefile b/TaskD03/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/TaskD03/run b/TaskD03/run new file mode 100644 index 0000000..5343b09 --- /dev/null +++ b/TaskD03/run @@ -0,0 +1,18 @@ +#!/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)