diff --git a/strelsovim/first/task1.py b/strelsovim/first/task1.py new file mode 100644 index 0000000..d9e4951 --- /dev/null +++ b/strelsovim/first/task1.py @@ -0,0 +1,4 @@ +x = input("Введіть елементи списку") +list + + diff --git a/strelsovim/first/task2.py b/strelsovim/first/task2.py new file mode 100644 index 0000000..8ea235a --- /dev/null +++ b/strelsovim/first/task2.py @@ -0,0 +1,8 @@ +x = input("") +list = [] +count = 0 +for i in range(length): + list[i] = input("" + str(i+1) + " ").split("") + if list[i] == []: + count +=1 +print("") diff --git a/strelsovim/second/task1.py b/strelsovim/second/task1.py new file mode 100644 index 0000000..354592c --- /dev/null +++ b/strelsovim/second/task1.py @@ -0,0 +1,13 @@ +""" +Використовуючи регулярні вирази, для поданого нижче тексту замініть кожне входження імен у форматі `Прізвище І.Б.` на імена у форматі `П.І.Б.` Виведіть результат. +""" + + +import re + +text = input("Введіть текст") + +#text = re.search(r"\w{A-z}\w{1}\w{1}""text") + +text = re.sub(r"\w{A-Z}{a-z}\w{1}.\w{1}.","\w{1}.\w{1}.\w{1}.",text) +print(text)