/
sejeenn
/
python_basic
Обзор
Документация
Войти
/
sejeenn
/
python_basic
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Module28/02_math_module/MyMath.py
30 строк
834 B
Eugene Vorontsov
Copy repo python basic
03 фев 2025, 20:23
03 фев 2025, 20:23
a8fce4a
Код
Авторство
О чём код?
import math from abc import ABC class MyMath(ABC): """Абстрактный класс MyMath""" @classmethod def circle_len(cls, radius: int) -> float: """Вычисление длины окружности""" return 2 * math.pi * radius @classmethod def circle_sq(cls, radius: int) -> float: """Вычисление площади круга""" return math.pi * radius ** 2 @classmethod def cube_value(cls, edge: int) -> float: """Вычисление объема куба""" return edge ** 3 @classmethod def sphere_area(cls, radius: int) -> float: """Вычисление площади сферы""" return 4 * math.pi * radius ** 2 @classmethod def square_area(cls, side: int) -> int: return side ** 2