Open
Conversation
Dzhoker1
reviewed
Jan 9, 2019
| # 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.
Отлично.
Для краткости можно удалить .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] | |||
|
|
||
| print(array, end="\n\n") | ||
|
|
||
| max = dict(index=0, value=array[0]) |
There was a problem hiding this comment.
Похоже я вас перехвалил в прошлый раз )))
Итак, торжественная обстановка. Я вручаю вам звезду. За утопленный самолёт конечно же.
Пересмотрите разбор ДЗ. Ту часть, где я говорил о плохих именах для переменных )))
| else: | ||
| nums[item] = 1 | ||
|
|
||
| max = dict(num=0, count=0) |
There was a problem hiding this comment.
Отлично... Наверное... Могло бы быть... )))
| @@ -0,0 +1,25 @@ | |||
| # 5. В массиве найти максимальный отрицательный элемент. Вывести на экран его значение и позицию в массиве. | |||
|
|
|||
| import random | |||
| @@ -0,0 +1,36 @@ | |||
| # 7. В одномерном массиве целых чисел определить два наименьших элемента. Они могут быть как равны между собой (оба являться минимальными), так и различаться. | |||
|
|
|||
| import random | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.