From ea6e7393f70e8dd487d00e98a0c3cd9c11d2a8a6 Mon Sep 17 00:00:00 2001 From: IvanDanilovKM-94 Date: Mon, 23 Dec 2019 16:53:13 +0200 Subject: [PATCH 1/5] upload task1 --- danilovid/second/task1.py.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 danilovid/second/task1.py.py diff --git a/danilovid/second/task1.py.py b/danilovid/second/task1.py.py new file mode 100644 index 0000000..106757e --- /dev/null +++ b/danilovid/second/task1.py.py @@ -0,0 +1,12 @@ +"Використовуючи регулярні вирази, для поданого нижче тексту замініть кожне входження автомобільного номеру у форматі `АА 0000 BB` на текст `[номер АА]`. Виведіть результат." + +import re + +print("Завдання 5") + +f1 = input("Введіть перші два елементи: ") +f2 = input("vvedite chisla: ") +f3 = input("Введіть перші два елементи: ") +stroka = (f1+f2+f3) +print(stroka) +print(re.compile((re.findall((r'\w{2}\s\d{4}\w{2}',"AA 0000 BB"))),'[nomer AA]')) \ No newline at end of file From ba34d9100595776eeb086e9a9cedea22e97e557c Mon Sep 17 00:00:00 2001 From: IvanDanilovKM-94 Date: Mon, 23 Dec 2019 16:59:17 +0200 Subject: [PATCH 2/5] fixed name of file --- danilovid/second/{task1.py.py => task1.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename danilovid/second/{task1.py.py => task1.py} (100%) diff --git a/danilovid/second/task1.py.py b/danilovid/second/task1.py similarity index 100% rename from danilovid/second/task1.py.py rename to danilovid/second/task1.py From be687c2d4a3eee09d8502595efe7a3f6fc43e42d Mon Sep 17 00:00:00 2001 From: IvanDanilovKM-94 Date: Mon, 23 Dec 2019 17:09:48 +0200 Subject: [PATCH 3/5] ready for code review --- danilovid/second/task1.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/danilovid/second/task1.py b/danilovid/second/task1.py index 106757e..3d566c3 100644 --- a/danilovid/second/task1.py +++ b/danilovid/second/task1.py @@ -1,5 +1,8 @@ -"Використовуючи регулярні вирази, для поданого нижче тексту замініть кожне входження автомобільного номеру у форматі `АА 0000 BB` на текст `[номер АА]`. Виведіть результат." - +""" +Використовуючи регулярні вирази, для поданого нижче тексту +замініть кожне входження автомобільного +номеру у форматі `АА 0000 BB` на текст `[номер АА]`. Виведіть результат. +""" import re print("Завдання 5") From a60d1ec9d5afb064dd72ecd4f2950ab00aa3f4d8 Mon Sep 17 00:00:00 2001 From: Tatiana Kornienko Date: Mon, 23 Dec 2019 23:14:58 +0200 Subject: [PATCH 4/5] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D1=88=D0=B0=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=82=D1=80=D0=BE=D0=BB=D1=8C=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- KornienkoT/first/task1.py | 2 ++ KornienkoT/first/task2.py | 10 ++++++++++ KornienkoT/first/task3.py | 14 ++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 KornienkoT/first/task1.py create mode 100644 KornienkoT/first/task2.py create mode 100644 KornienkoT/first/task3.py diff --git a/KornienkoT/first/task1.py b/KornienkoT/first/task1.py new file mode 100644 index 0000000..1190ad3 --- /dev/null +++ b/KornienkoT/first/task1.py @@ -0,0 +1,2 @@ +lis = [1, 4 ,7 ,"f", [], [], []] +print (lis.count([])) \ No newline at end of file diff --git a/KornienkoT/first/task2.py b/KornienkoT/first/task2.py new file mode 100644 index 0000000..2423404 --- /dev/null +++ b/KornienkoT/first/task2.py @@ -0,0 +1,10 @@ +sentence = input() +print (sentence) + +CapLetters = sentence.split(" ") +print (CapLetters) + +for word in CapLetters: + for symb in word: + if (symb.isupper()): + print (word) \ No newline at end of file diff --git a/KornienkoT/first/task3.py b/KornienkoT/first/task3.py new file mode 100644 index 0000000..5249e43 --- /dev/null +++ b/KornienkoT/first/task3.py @@ -0,0 +1,14 @@ +lis = ["h","t", 3, 7, 9, {}] + +number = [] +string = [] + +for i in lis: + elem = type(i) + if (elem == float or elem == int): + number.append(i) + + elif (elem == str): + string.append(i) + +print ( sum (number)) \ No newline at end of file From c6641005534d098faf824e84e406d91316c678f1 Mon Sep 17 00:00:00 2001 From: Tatiana Kornienko Date: Mon, 23 Dec 2019 23:23:27 +0200 Subject: [PATCH 5/5] =?UTF-8?q?=D0=94=D0=BE=D0=B4=D0=B0=D0=BD=D1=96=20?= =?UTF-8?q?=D1=83=D0=BC=D0=BE=D0=B2=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- KornienkoT/first/task1.py | 4 +++- KornienkoT/first/task2.py | 4 +++- KornienkoT/first/task3.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/KornienkoT/first/task1.py b/KornienkoT/first/task1.py index 1190ad3..6fea5c8 100644 --- a/KornienkoT/first/task1.py +++ b/KornienkoT/first/task1.py @@ -1,2 +1,4 @@ lis = [1, 4 ,7 ,"f", [], [], []] -print (lis.count([])) \ No newline at end of file +print (lis.count([])) + +# Для заданого списку вивести список , який складається із пустих списків \ No newline at end of file diff --git a/KornienkoT/first/task2.py b/KornienkoT/first/task2.py index 2423404..7916a9b 100644 --- a/KornienkoT/first/task2.py +++ b/KornienkoT/first/task2.py @@ -7,4 +7,6 @@ for word in CapLetters: for symb in word: if (symb.isupper()): - print (word) \ No newline at end of file + print (word) + +#Користувая вводить текст, вивести усі слова цього тексту, що містять велику букву, у вигляді списку \ No newline at end of file diff --git a/KornienkoT/first/task3.py b/KornienkoT/first/task3.py index 5249e43..0577c39 100644 --- a/KornienkoT/first/task3.py +++ b/KornienkoT/first/task3.py @@ -11,4 +11,6 @@ elif (elem == str): string.append(i) -print ( sum (number)) \ No newline at end of file +print ( sum (number)) + +#Для заданого списку чисел, вивести суму усіх чисел і реузльтат конкантенації рядкових елементів \ No newline at end of file