From 41914574137ac14e7bb5fd22c3992ab6b315387c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zofia=20B=C4=85czyk?= Date: Sun, 6 Dec 2020 17:54:16 +0100 Subject: [PATCH] atempt 1 --- TaskD02/Makefile | 0 TaskD02/run | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 TaskD02/Makefile create mode 100644 TaskD02/run diff --git a/TaskD02/Makefile b/TaskD02/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/TaskD02/run b/TaskD02/run new file mode 100644 index 0000000..f7a6a59 --- /dev/null +++ b/TaskD02/run @@ -0,0 +1,27 @@ +#!/usr/bin/python3 + +import sys +import re + +for input in sys.stdin.readlines(): + count = 0 + answer = re.findall('[a-ząćęłńóśźż]',input) + if answer: + count+=len(answer) + print(str(len(answer))+" ", end="") + else: + print("0 ", end="") + answer = re.findall('[A-ZĄĆĘŁŃÓŚŹŻ]',input) + if answer: + count+=len(answer) + print(str(len(answer))+" ", end="") + else: + print("0 ", end="") + answer = re.findall('[0-9]',input) + if answer: + count+=len(answer) + print(str(len(answer))+" ", end="") + else: + print("0 ", end="") + print(str(len(input)-1 - count)) +