-
Notifications
You must be signed in to change notification settings - Fork 0
hw3 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
hw3 #3
Conversation
Dzhoker1
left a comment
There was a problem hiding this 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(): |
There was a problem hiding this comment.
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] | |||
There was a problem hiding this comment.
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]) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отличное решение
No description provided.