This repository has been archived on 2025-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Files
python_it_top/Practica1/task_2_rpo254.py

30 lines
976 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Информирование об названии программы
print(":: Нахождение арифметическое(среднее, максимум, минимум) ::\n")
# Ввод 3 чисел
input_three=input("Введите 3 числа :: ")
# Валидация ввода 3 чисел
if len(input_three) != 3:
print("Ошибка: введите именно 3 числа!")
sys.exit(0)
# Перевод чисел в список
number_list = [int(list1) for list1 in input_three]
# Среднее, максимальное и меньшее арифметическое
average_arifmet = sum(number_list) // len(input_three)
min_arifmet = min(input_three)
max_arifmet = max(input_three)
# Вывод в терминал
print("Вывод:\n"
" - Минимум: {}\n"
" - Среднее: {}\n"
" - Болшее: {}"
.format(min_arifmet,
average_arifmet,
max_arifmet
)
)