from loguru import logger RED = color.Color("Red") BLUE = color.Color("Blue") GREEN = color.Color("Green") def printfigure(figure: GF): print(f"{figure}\nArea is {figure.area()}") if __name__ == "__main__": r = rect.Rect(25, 25, BLUE) printfigure(r) c = circle.Circle(25, GREEN) printfigure(c) s = square.Square(25, RED) printfigure(s) logger.debug("Hello, cool debugger") # import abc # class Food(abc.ABC): # @abc.abstractmethod # def cut(self): # pass # # class Meat(Food): # def cut(self): # pass # # class Apple(Food): # def cut(self): # pass
def main(): print(circle.Circle(5, "Зелёный")) print(rectangle.Rectangle(3, 2, "Синий")) print(square.Square(5, "Красный"))
def main(): print(circle.Circle(12, "Бежевый")) print(rectangle.Rectangle(12, 9, "Красный")) print(square.Square(11, "Зелёный"))
def setUp(self): self.square = square.Square(2, "Красный")
# Квадрат elif res == '2': work1 = True while work1: print("Введите сторону квадрата:") try: a = int(input()) work1 = False except (TypeError, ValueError): print("Введите число!") print("Введите цвет:") cool = colour.Colour cool.v = input() sq = square.Square(a, cool.v) print(sq.gn()) sq.__repr__() # Круг elif res == '3': print("Введите радиус:") work1 = True while work1: try: a = int(input()) work1 = False except (TypeError, ValueError): print("Введите число!") print("Введите цвет:")