Skip to content

hw3#3

Open
poluninatm wants to merge 1 commit into
masterfrom
hw3
Open

hw3#3
poluninatm wants to merge 1 commit into
masterfrom
hw3

Conversation

@poluninatm
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@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.

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

Comment thread task_1.py
# print(nums_data)

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

Choose a reason for hiding this comment

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

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

Comment thread task_2.py
@@ -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
Copy Markdown

Choose a reason for hiding this comment

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

Отлично

Comment thread task_3.py

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

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

Choose a reason for hiding this comment

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

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

Comment thread task_4.py
else:
nums[item] = 1

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

Choose a reason for hiding this comment

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

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

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

import random
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

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

import random
Copy link
Copy Markdown

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.

2 participants