diff --git a/example/.DS_Store b/example/.DS_Store new file mode 100644 index 0000000..a40e5ee Binary files /dev/null and b/example/.DS_Store differ diff --git a/zernovmo/.DS_Store b/zernovmo/.DS_Store new file mode 100644 index 0000000..0f66966 Binary files /dev/null and b/zernovmo/.DS_Store differ diff --git a/zernovmo/first/task1.py b/zernovmo/first/task1.py new file mode 100644 index 0000000..e7aec4d --- /dev/null +++ b/zernovmo/first/task1.py @@ -0,0 +1,10 @@ +''' +Посчитать кол-во пустых списков в списке +''' + +inpt = [1, [], 2, []] +count = 0 +for item in inpt: + if item == []: + count += 1 +print(count) \ No newline at end of file diff --git a/zernovmo/first/task2.py b/zernovmo/first/task2.py new file mode 100644 index 0000000..efb4afe --- /dev/null +++ b/zernovmo/first/task2.py @@ -0,0 +1,10 @@ +''' +Найти слова в предложении которые содержат большой символ +''' + +inpt = "kjshfjsad jjhsdfHkhj asasdAdgg" +result = [] +for item in inpt.split(): + if any(c.isupper() for c in item): + result.append(item) +print(result) \ No newline at end of file diff --git a/zernovmo/first/task3.py b/zernovmo/first/task3.py new file mode 100644 index 0000000..e342dfe --- /dev/null +++ b/zernovmo/first/task3.py @@ -0,0 +1,17 @@ +''' +Елементами масива являются числа и строки, вывести отдельно строки через пробел, отдельно сумму чисел +''' + +inpt = [1, '2', 3, '4'] + +resString = '' +resNum = 0 + +for item in inpt: + if isinstance(item, str): + resString += ' ' + resString += item + elif isinstance(item, int): + resNum += item +print('Строка: ', resString) +print('Число: ', resNum)