Skip to content

lesson3 - #3

Open
b0rsh3c wants to merge 1 commit into
masterfrom
lesson3
Open

lesson3#3
b0rsh3c wants to merge 1 commit into
masterfrom
lesson3

Conversation

@b0rsh3c

@b0rsh3c b0rsh3c commented Jan 15, 2020

Copy link
Copy Markdown
Owner

No description provided.

Comment thread Lesson_3/1.py
result[n].append(f)
print(
f'Для числа {n} кратны - {len(result[n])}. Кратные числа: {result[n]}.'
) No newline at end of file

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 Lesson_3/2.py
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

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 Lesson_3/3.py
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}')

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 Lesson_3/4.py
most_common = item # запоминаем само значение

# вывод значения на экран
print(f'Число {most_common}, встречается {count_most_common} раза') No newline at end of file

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 Lesson_3/5.py
print(f'Позиция максимального отрицательного элемента = {min_index}')



Copy link
Copy Markdown

Choose a reason for hiding this comment

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

я на уроке уточнил, что Максимальный отрицательный элемент - ближе к 0
нужно доработать

Наш массив: [-5, -9, -24, -27, -7, -22, -19, -3, -3]
Максимальный отрицательный элемент = -27
Позиция максимального отрицательного элемента = 4

Comment thread Lesson_3/6.py
print(
f'Сумма элементов между минимальным ({r[min_index]})',
f' и максимальным ({r[max_index]}) элементами: {sum}'
) No newline at end of file

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 Lesson_3/7.py

print(
f'Два наименьших элемента (второй способ): {sort_list[0]} и {sort_list[1]}'
) No newline at end of file

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 Lesson_3/8.py
matrix[i].append(sum)

for a in matrix:
print(('{:>4d}' * 5).format(*a)) No newline at end of file

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 Lesson_3/9.py
print(
'Максимальный элемент среди минимальных элементов столбцов матрицы: ',
min_list[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.

отлично

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