def main(): test_rectangle = rectangle.Rectangle(2, 3, "синий") test_circle = circle.Circle(5, "зелёный") test_square = rec_square.Square(5, "красный") print(test_rectangle.get_name(), end="\n") print(test_rectangle) print(test_circle.get_name(), end="\n") print(test_circle) print(test_square.get_name(), end=":\n") print(test_square)
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.rectangle = rectangle.Rectangle(2, 2, "Красный")
except (TypeError, ValueError): print("Введите число!") work1 = True while work1: print("Введите ширину:") try: b = int(input()) work1 = False except (TypeError, ValueError): print("Введите число!") print("Введите цвет:") cool = colour.Colour() cool.v = input() rec = rectangle.Rectangle(a, b, cool.v) print(rec.gn()) rec.__repr__() # Квадрат elif res == '2': work1 = True while work1: print("Введите сторону квадрата:") try: a = int(input()) work1 = False except (TypeError, ValueError): print("Введите число!") print("Введите цвет:")