Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions KornienkoT/first/task1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lis = [1, 4 ,7 ,"f", [], [], []]
print (lis.count([]))

# Для заданого списку вивести список , який складається із пустих списків
12 changes: 12 additions & 0 deletions KornienkoT/first/task2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sentence = input()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can improve input("Write text: ")

print (sentence)

CapLetters = sentence.split(" ")
print (CapLetters)

for word in CapLetters:
for symb in word:
if (symb.isupper()):
print (word)

#Користувая вводить текст, вивести усі слова цього тексту, що містять велику букву, у вигляді списку
16 changes: 16 additions & 0 deletions KornienkoT/first/task3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
lis = ["h","t", 3, 7, 9, {}]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def task3(lis):
    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))
print (task3(lis))

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))

#Для заданого списку чисел, вивести суму усіх чисел і реузльтат конкантенації рядкових елементів
15 changes: 15 additions & 0 deletions danilovid/second/task1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
Використовуючи регулярні вирази, для поданого нижче тексту
замініть кожне входження автомобільного
номеру у форматі `АА 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]'))