Conversation
| result[n].append(f) | ||
| print( | ||
| f'Для числа {n} кратны - {len(result[n])}. Кратные числа: {result[n]}.' | ||
| ) No newline at end of file |
| for n in massive_a: | ||
| if n % 2 == 0: | ||
| massive_b.append(massive_a.index(n)) | ||
| print(f'Индексы чертных элеметов первого массива: {massive_b}') No newline at end of file |
| min_index = r.index(min) | ||
| max_index = r.index(max) | ||
| r[min_index], r[max_index] = r[max_index], r[min_index] | ||
| print(f'Массив после изменения элементов {min_index} и {max_index}: {r}') |
| most_common = item # запоминаем само значение | ||
|
|
||
| # вывод значения на экран | ||
| print(f'Число {most_common}, встречается {count_most_common} раза') No newline at end of file |
| print(f'Позиция максимального отрицательного элемента = {min_index}') | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
я на уроке уточнил, что Максимальный отрицательный элемент - ближе к 0
нужно доработать
Наш массив: [-5, -9, -24, -27, -7, -22, -19, -3, -3]
Максимальный отрицательный элемент = -27
Позиция максимального отрицательного элемента = 4
| print( | ||
| f'Сумма элементов между минимальным ({r[min_index]})', | ||
| f' и максимальным ({r[max_index]}) элементами: {sum}' | ||
| ) No newline at end of file |
|
|
||
| print( | ||
| f'Два наименьших элемента (второй способ): {sort_list[0]} и {sort_list[1]}' | ||
| ) No newline at end of file |
There was a problem hiding this comment.
желательно пока без сортировок
мы до них еще не дошли
| matrix[i].append(sum) | ||
|
|
||
| for a in matrix: | ||
| print(('{:>4d}' * 5).format(*a)) No newline at end of file |
There was a problem hiding this comment.
можно сделать авто заполнение матрицы
| print( | ||
| 'Максимальный элемент среди минимальных элементов столбцов матрицы: ', | ||
| min_list[0] | ||
| ) |
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.