Skip to content

Conversation

@poluninatm
Copy link
Owner

No description provided.

Copy link

@Dzhoker1 Dzhoker1 left a comment

Choose a reason for hiding this comment

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

Оставил комментарии по коду

# print(nums_data)

for num in range(RANGE_START, RANGE_STOP + 1):
for i in nums_data.keys():
Copy link

Choose a reason for hiding this comment

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

Отлично.
Для краткости можно удалить .keys(). Без него всё равно будет проверка по ключам.

@@ -0,0 +1,11 @@
# Во втором массиве сохранить индексы четных элементов первого массива. Например, если дан массив со значениями 8, 3, 15, 6, 4, 2, то во второй массив надо заполнить значениями 1, 4, 5, 6 (или 0, 3, 4, 5 - если индексация начинается с нуля), т.к. именно в этих позициях первого массива стоят четные числа.

array_1=[8, 3, 15, 6, 4, 2]
Copy link

Choose a reason for hiding this comment

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

Отлично


print(array, end="\n\n")

max = dict(index=0, value=array[0])
Copy link

Choose a reason for hiding this comment

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

Похоже я вас перехвалил в прошлый раз )))
Итак, торжественная обстановка. Я вручаю вам звезду. За утопленный самолёт конечно же.
Пересмотрите разбор ДЗ. Ту часть, где я говорил о плохих именах для переменных )))

else:
nums[item] = 1

max = dict(num=0, count=0)
Copy link

Choose a reason for hiding this comment

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

Отлично... Наверное... Могло бы быть... )))

@@ -0,0 +1,25 @@
# 5. В массиве найти максимальный отрицательный элемент. Вывести на экран его значение и позицию в массиве.

import random
Copy link

Choose a reason for hiding this comment

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

Отличный алгоритм

@@ -0,0 +1,36 @@
# 7. В одномерном массиве целых чисел определить два наименьших элемента. Они могут быть как равны между собой (оба являться минимальными), так и различаться.

import random
Copy link

Choose a reason for hiding this comment

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

Отличное решение

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants