From 00b48fc78fa0b3220f67b777d0cdfed91e5620c2 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 6 Dec 2020 15:46:34 +0100 Subject: [PATCH] do3 --- TaskD03/Makefile | 0 TaskD03/run | 2 ++ TaskD03/run.py | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 TaskD03/Makefile create mode 100644 TaskD03/run create mode 100644 TaskD03/run.py 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..ac23193 --- /dev/null +++ b/TaskD03/run @@ -0,0 +1,2 @@ +#!/bin/bash +python TaskD03/run.py "$@" \ No newline at end of file diff --git a/TaskD03/run.py b/TaskD03/run.py new file mode 100644 index 0000000..c1d8502 --- /dev/null +++ b/TaskD03/run.py @@ -0,0 +1,19 @@ +import re +import sys + + +def check(line): + A = len(re.findall(r'\b[a-ząćęłńóśźż]\w*\b', line)) + B = len(re.findall(r'\b[A-ZĄĆĘŁŃÓŚŹŻ]\w*\b', line)) + + return "{} {}".format(A, B) + +for line in sys.stdin: + print(check(line)) + + + + + + +