Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added task_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions task_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
n = int(input("Введите трехзначное число: "))
d1 = n % 10
d2 = n // 10 % 10
d3 = n // 100
print("Сумма цифр числа:", d1 + d2 + d3)

Choose a reason for hiding this comment

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

Не стоит смешивать процесс и ввод. А ещё не стоит копировать код в блоки графического алгоритма. Ведь если вы пришли за знаниями и новым опытом, первая строчка кода должна быть написана после полного завершения графического алгоритма.

print("Произведение цифр числа:", d1 * d2 * d3)
Binary file added task_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions task_3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
x1 = float(input('Введите кординаты x1 '))
y1 = float(input('Введите кординаты y1 '))
x2 = float(input('Введите кординаты x2 '))
y2 = float(input('Введите кординаты y2 '))
k = (y2 - y1)/(x2 - x1)

Choose a reason for hiding this comment

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

Если прямая вертикальная и оба "икса" равны, то программа выпадает с ошибкой деления на ноль.

b = y1 - k * x1
print(f'Уравнение прямой: y = {k}x + {b}')
Binary file added task_7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions task_7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
a = float(input('Введите длину стороны a: '))
b = float(input('Введите длину стороны b: '))
c = float(input('Введите длину стороны c: '))
if a < b + c and b < a + c and c < a + b:
if a == b and b == c:
print(f'Треугольник со сторонами {a} {b} {c} - равносторонний')
elif a == b or b == c or c == a:
print(f'Треугольник со сторонами {a} {b} {c} - равнобедренный ')
else:
print(f'Треугольник со сторонами {a} {b} {c} - разносторонний')
else:
print(f'Треугольника со сторонами {a} {b} {c} не существует')
Binary file added task_8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions task_8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
year = int(input('Введите год: '))
if year % 400 == 0:
print(f"Год {year} високосный")
elif year % 100 != 0 and year % 4 == 0:
print(f"Год {year} високосный")
else:
print(f"Год {year} невисокосный")
Binary file added task_9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions task_9.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
a = int(input('Введите число a: '))
b = int(input('Введите число b: '))
c = int(input('Введите число c: '))
if b < a < c or c < a < b:
print(f'Среднее число: {a}')
elif a < b < c or c < b < a:
print(f'Среднее число: {b}')
else:
print(f'Среднее число: {c}')